diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md index 24d85d5bf46a..510b64a8c1ee 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md @@ -1,5 +1,110 @@ # Release History +## 2.0.0 (2025-04-07) +### Breaking Changes + +- Type of `AssociatedWorkspace.AssociateDate` has been changed from `*string` to `*time.Time` +- Type of `CapacityReservationProperties.LastSKUUpdate` has been changed from `*string` to `*time.Time` +- Type of `Cluster.Identity` has been changed from `*Identity` to `*ManagedServiceIdentity` +- Type of `ClusterPatch.Identity` has been changed from `*Identity` to `*ManagedServiceIdentity` +- Type of `ClusterProperties.CreatedDate` has been changed from `*string` to `*time.Time` +- Type of `ClusterProperties.LastModifiedDate` has been changed from `*string` to `*time.Time` +- Type of `WorkspaceProperties.CreatedDate` has been changed from `*string` to `*time.Time` +- Type of `WorkspaceProperties.ModifiedDate` has been changed from `*string` to `*time.Time` +- Type of `WorkspaceSKU.LastSKUUpdate` has been changed from `*string` to `*time.Time` +- Operation `*TablesClient.Update` has been changed to LRO, use `*TablesClient.BeginUpdate` instead. + +### Features Added + +- New value `CapacityFiftyThousand`, `CapacityFourHundred`, `CapacityOneHundred`, `CapacityTenThousand`, `CapacityThreeHundred`, `CapacityTwentyFiveThousand`, `CapacityTwoHundred` added to enum type `Capacity` +- New value `CapacityReservationLevelFiftyThousand`, `CapacityReservationLevelTenThousand`, `CapacityReservationLevelTwentyFiveThousand` added to enum type `CapacityReservationLevel` +- New value `DataSourceTypeIngestion` added to enum type `DataSourceType` +- New enum type `AccessRuleDirection` with values `AccessRuleDirectionInbound`, `AccessRuleDirectionOutbound` +- New enum type `ClusterReplicationState` with values `ClusterReplicationStateCanceled`, `ClusterReplicationStateDisableRequested`, `ClusterReplicationStateDisabling`, `ClusterReplicationStateEnableRequested`, `ClusterReplicationStateEnabling`, `ClusterReplicationStateFailed`, `ClusterReplicationStateRollbackRequested`, `ClusterReplicationStateRollingBack`, `ClusterReplicationStateSucceeded` +- New enum type `ColumnDataTypeHintEnum` with values `ColumnDataTypeHintEnumArmPath`, `ColumnDataTypeHintEnumGUID`, `ColumnDataTypeHintEnumIP`, `ColumnDataTypeHintEnumURI` +- New enum type `ColumnTypeEnum` with values `ColumnTypeEnumBoolean`, `ColumnTypeEnumDateTime`, `ColumnTypeEnumDynamic`, `ColumnTypeEnumGUID`, `ColumnTypeEnumInt`, `ColumnTypeEnumLong`, `ColumnTypeEnumReal`, `ColumnTypeEnumString` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `IssueType` with values `IssueTypeConfigurationPropagationFailure`, `IssueTypeMissingIdentityConfiguration`, `IssueTypeMissingPerimeterConfiguration`, `IssueTypeUnknown` +- New enum type `ManagedServiceIdentityType` with values `ManagedServiceIdentityTypeNone`, `ManagedServiceIdentityTypeSystemAssigned`, `ManagedServiceIdentityTypeSystemAssignedUserAssigned`, `ManagedServiceIdentityTypeUserAssigned` +- New enum type `NetworkSecurityPerimeterConfigurationProvisioningState` with values `NetworkSecurityPerimeterConfigurationProvisioningStateAccepted`, `NetworkSecurityPerimeterConfigurationProvisioningStateCanceled`, `NetworkSecurityPerimeterConfigurationProvisioningStateCreating`, `NetworkSecurityPerimeterConfigurationProvisioningStateDeleting`, `NetworkSecurityPerimeterConfigurationProvisioningStateFailed`, `NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded`, `NetworkSecurityPerimeterConfigurationProvisioningStateUpdating` +- New enum type `ProvisioningStateEnum` with values `ProvisioningStateEnumDeleting`, `ProvisioningStateEnumInProgress`, `ProvisioningStateEnumSucceeded`, `ProvisioningStateEnumUpdating` +- New enum type `ResourceAssociationAccessMode` with values `ResourceAssociationAccessModeAudit`, `ResourceAssociationAccessModeEnforced`, `ResourceAssociationAccessModeLearning` +- New enum type `Severity` with values `SeverityError`, `SeverityWarning` +- New enum type `SourceEnum` with values `SourceEnumCustomer`, `SourceEnumMicrosoft` +- New enum type `TablePlanEnum` with values `TablePlanEnumAnalytics`, `TablePlanEnumBasic` +- New enum type `TableSubTypeEnum` with values `TableSubTypeEnumAny`, `TableSubTypeEnumClassic`, `TableSubTypeEnumDataCollectionRuleBased` +- New enum type `TableTypeEnum` with values `TableTypeEnumCustomLog`, `TableTypeEnumMicrosoft`, `TableTypeEnumRestoredLogs`, `TableTypeEnumSearchResults` +- New enum type `WorkspaceFailoverState` with values `WorkspaceFailoverStateActivating`, `WorkspaceFailoverStateActive`, `WorkspaceFailoverStateDeactivating`, `WorkspaceFailoverStateFailed`, `WorkspaceFailoverStateInactive` +- New enum type `WorkspaceReplicationState` with values `WorkspaceReplicationStateCanceled`, `WorkspaceReplicationStateDisableRequested`, `WorkspaceReplicationStateDisabling`, `WorkspaceReplicationStateEnableRequested`, `WorkspaceReplicationStateEnabling`, `WorkspaceReplicationStateFailed`, `WorkspaceReplicationStateRollbackRequested`, `WorkspaceReplicationStateRollingBack`, `WorkspaceReplicationStateSucceeded` +- New function `*ClientFactory.NewQueriesClient() *QueriesClient` +- New function `*ClientFactory.NewQueryPacksClient() *QueryPacksClient` +- New function `NewQueriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*QueriesClient, error)` +- New function `*QueriesClient.Delete(context.Context, string, string, string, *QueriesClientDeleteOptions) (QueriesClientDeleteResponse, error)` +- New function `*QueriesClient.Get(context.Context, string, string, string, *QueriesClientGetOptions) (QueriesClientGetResponse, error)` +- New function `*QueriesClient.NewListPager(string, string, *QueriesClientListOptions) *runtime.Pager[QueriesClientListResponse]` +- New function `*QueriesClient.Put(context.Context, string, string, string, LogAnalyticsQueryPackQuery, *QueriesClientPutOptions) (QueriesClientPutResponse, error)` +- New function `*QueriesClient.NewSearchPager(string, string, LogAnalyticsQueryPackQuerySearchProperties, *QueriesClientSearchOptions) *runtime.Pager[QueriesClientSearchResponse]` +- New function `*QueriesClient.Update(context.Context, string, string, string, LogAnalyticsQueryPackQuery, *QueriesClientUpdateOptions) (QueriesClientUpdateResponse, error)` +- New function `NewQueryPacksClient(string, azcore.TokenCredential, *arm.ClientOptions) (*QueryPacksClient, error)` +- New function `*QueryPacksClient.CreateOrUpdate(context.Context, string, string, LogAnalyticsQueryPack, *QueryPacksClientCreateOrUpdateOptions) (QueryPacksClientCreateOrUpdateResponse, error)` +- New function `*QueryPacksClient.CreateOrUpdateWithoutName(context.Context, string, LogAnalyticsQueryPack, *QueryPacksClientCreateOrUpdateWithoutNameOptions) (QueryPacksClientCreateOrUpdateWithoutNameResponse, error)` +- New function `*QueryPacksClient.Delete(context.Context, string, string, *QueryPacksClientDeleteOptions) (QueryPacksClientDeleteResponse, error)` +- New function `*QueryPacksClient.Get(context.Context, string, string, *QueryPacksClientGetOptions) (QueryPacksClientGetResponse, error)` +- New function `*QueryPacksClient.NewListByResourceGroupPager(string, *QueryPacksClientListByResourceGroupOptions) *runtime.Pager[QueryPacksClientListByResourceGroupResponse]` +- New function `*QueryPacksClient.NewListPager(*QueryPacksClientListOptions) *runtime.Pager[QueryPacksClientListResponse]` +- New function `*QueryPacksClient.UpdateTags(context.Context, string, string, TagsResource, *QueryPacksClientUpdateTagsOptions) (QueryPacksClientUpdateTagsResponse, error)` +- New function `*TablesClient.CancelSearch(context.Context, string, string, string, *TablesClientCancelSearchOptions) (TablesClientCancelSearchResponse, error)` +- New function `*TablesClient.BeginCreateOrUpdate(context.Context, string, string, string, Table, *TablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[TablesClientCreateOrUpdateResponse], error)` +- New function `*TablesClient.BeginDelete(context.Context, string, string, string, *TablesClientBeginDeleteOptions) (*runtime.Poller[TablesClientDeleteResponse], error)` +- New function `*TablesClient.Migrate(context.Context, string, string, string, *TablesClientMigrateOptions) (TablesClientMigrateResponse, error)` +- New function `*WorkspacesClient.GetNSP(context.Context, string, string, string, *WorkspacesClientGetNSPOptions) (WorkspacesClientGetNSPResponse, error)` +- New function `*WorkspacesClient.NewListNSPPager(string, string, *WorkspacesClientListNSPOptions) *runtime.Pager[WorkspacesClientListNSPResponse]` +- New function `*WorkspacesClient.BeginReconcileNSP(context.Context, string, string, string, *WorkspacesClientBeginReconcileNSPOptions) (*runtime.Poller[WorkspacesClientReconcileNSPResponse], error)` +- New struct `AccessRule` +- New struct `AccessRuleProperties` +- New struct `AccessRulePropertiesSubscriptionsItem` +- New struct `ClusterReplicationProperties` +- New struct `Column` +- New struct `LogAnalyticsQueryPack` +- New struct `LogAnalyticsQueryPackListResult` +- New struct `LogAnalyticsQueryPackProperties` +- New struct `LogAnalyticsQueryPackQuery` +- New struct `LogAnalyticsQueryPackQueryListResult` +- New struct `LogAnalyticsQueryPackQueryProperties` +- New struct `LogAnalyticsQueryPackQueryPropertiesRelated` +- New struct `LogAnalyticsQueryPackQuerySearchProperties` +- New struct `LogAnalyticsQueryPackQuerySearchPropertiesRelated` +- New struct `ManagedServiceIdentity` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationListResult` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityProfile` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New struct `ProxyResourceAutoGenerated` +- New struct `ResourceAssociation` +- New struct `ResourceAutoGenerated` +- New struct `RestoredLogs` +- New struct `ResultStatistics` +- New struct `Schema` +- New struct `SearchResults` +- New struct `SystemData` +- New struct `TagsResource` +- New struct `TrackedResourceAutoGenerated` +- New struct `UserAssignedIdentity` +- New struct `WorkspaceFailoverProperties` +- New struct `WorkspaceReplicationPatProperties` +- New struct `WorkspaceReplicationProperties` +- New field `Replication` in struct `ClusterProperties` +- New field `SystemData` in struct `Table` +- New field `ArchiveRetentionInDays`, `LastPlanModifiedDate`, `Plan`, `ProvisioningState`, `RestoredLogs`, `ResultStatistics`, `RetentionInDaysAsDefault`, `Schema`, `SearchResults`, `TotalRetentionInDays`, `TotalRetentionInDaysAsDefault` in struct `TableProperties` +- New field `Identity`, `SystemData` in struct `Workspace` +- New field `UnifiedSentinelBillingOnly` in struct `WorkspaceFeatures` +- New field `Identity` in struct `WorkspacePatch` +- New field `DefaultDataCollectionRuleResourceID`, `Failover`, `Replication` in struct `WorkspaceProperties` + + ## 2.0.0-beta.4 (2024-08-19) ### Features Added diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md index f469ac1dfc32..9e8a357f1585 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/operationalinsights/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/operationalinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.4 -tag: package-2022-02 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go index bb8668666d50..7c4c490743f7 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAvailableServiceTiersClient(subscriptionID string, credential azcore.Tok // ListByWorkspace - Gets the available service tiers for the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - AvailableServiceTiersClientListByWorkspaceOptions contains the optional parameters for the AvailableServiceTiersClient.ListByWorkspace @@ -74,7 +71,7 @@ func (client *AvailableServiceTiersClient) ListByWorkspace(ctx context.Context, } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *AvailableServiceTiersClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *AvailableServiceTiersClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *AvailableServiceTiersClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *AvailableServiceTiersClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -93,7 +90,7 @@ func (client *AvailableServiceTiersClient) listByWorkspaceCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client_example_test.go deleted file mode 100644 index 83b18fab51d1..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/availableservicetiers_client_example_test.go +++ /dev/null @@ -1,55 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesAvailableServiceTiers.json -func ExampleAvailableServiceTiersClient_ListByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailableServiceTiersClient().ListByWorkspace(ctx, "rg1", "workspace1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailableServiceTierArray = []*armoperationalinsights.AvailableServiceTier{ - // { - // DefaultRetention: to.Ptr[int64](7), - // Enabled: to.Ptr(true), - // MaximumRetention: to.Ptr[int64](30), - // MinimumRetention: to.Ptr[int64](7), - // ServiceTier: to.Ptr(armoperationalinsights.SKUNameEnumPerNode), - // }, - // { - // CapacityReservationLevel: to.Ptr[int64](200), - // DefaultRetention: to.Ptr[int64](30), - // Enabled: to.Ptr(true), - // LastSKUUpdate: to.Ptr("2020-02-04T08:55:03.871Z"), - // MaximumRetention: to.Ptr[int64](300), - // MinimumRetention: to.Ptr[int64](30), - // ServiceTier: to.Ptr(armoperationalinsights.SKUNameEnumCapacityReservation), - // }} -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/client_factory.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/client_factory.go index caa46c08491d..82654fa8ec91 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/client_factory.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/client_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go index 30d618836d46..e1d324c80273 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a Log Analytics cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Log Analytics cluster. // - parameters - The parameters required to create or update a Log Analytics cluster. @@ -72,7 +69,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a Log Analytics cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginCreateOrUpdate" @@ -87,7 +84,7 @@ func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { err = runtime.NewResponseError(httpResp) return nil, err } @@ -95,7 +92,7 @@ func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, _ *ClustersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -114,7 +111,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +123,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes a cluster instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Name of the Log Analytics Cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -150,7 +147,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a cluster instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginDelete" @@ -173,7 +170,7 @@ func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroup } // deleteCreateRequest creates the Delete request. -func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ClustersClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -192,7 +189,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +198,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets a Log Analytics cluster instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Name of the Log Analytics Cluster. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -228,7 +225,7 @@ func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (*policy.Request, error) { +func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ClustersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,7 +244,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +261,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // NewListPager - Gets the Log Analytics clusters in a subscription. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{ @@ -290,7 +287,7 @@ func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) * } // listCreateRequest creates the List request. -func (client *ClustersClient) listCreateRequest(ctx context.Context, options *ClustersClientListOptions) (*policy.Request, error) { +func (client *ClustersClient) listCreateRequest(ctx context.Context, _ *ClustersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -301,7 +298,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, options *Cl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,7 +315,7 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // NewListByResourceGroupPager - Gets Log Analytics clusters in a resource group. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -346,7 +343,7 @@ func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ClustersClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -361,7 +358,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,7 +376,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // BeginUpdate - Updates a Log Analytics cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - Name of the Log Analytics Cluster. // - parameters - The parameters required to patch a Log Analytics cluster. @@ -404,7 +401,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a Log Analytics cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2025-02-01 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatch, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ClustersClient.BeginUpdate" @@ -427,7 +424,7 @@ func (client *ClustersClient) update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatch, options *ClustersClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatch, _ *ClustersClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -446,7 +443,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client_example_test.go deleted file mode 100644 index b043792fa14c..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/clusters_client_example_test.go +++ /dev/null @@ -1,371 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("oiautorest6685", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armoperationalinsights.ClusterListResult{ - // Value: []*armoperationalinsights.Cluster{ - // { - // Name: to.Ptr("TestResourceLock"), - // Type: to.Ptr("Microsoft.OperationalInsights/clusters"), - // ID: to.Ptr("/subscriptions/594038b5-1093-476e-a366-482775671c11/resourcegroups/calbot-rg/providers/microsoft.operationalinsights/clusters/testresourcelock"), - // Location: to.Ptr("eastus"), - // Identity: &armoperationalinsights.Identity{ - // Type: to.Ptr(armoperationalinsights.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("356d057d-cba5-44dd-8a30-b2e547bc416b"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // Properties: &armoperationalinsights.ClusterProperties{ - // ClusterID: to.Ptr("5b02755b-5bf4-430c-9487-45502a2a7e62"), - // KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - // KeyName: to.Ptr("aztest2170cert"), - // KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - // KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - // }, - // ProvisioningState: to.Ptr(armoperationalinsights.ClusterEntityStatusSucceeded), - // }, - // SKU: &armoperationalinsights.ClusterSKU{ - // Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - // Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersSubscriptionList.json -func ExampleClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armoperationalinsights.ClusterListResult{ - // Value: []*armoperationalinsights.Cluster{ - // { - // Name: to.Ptr("TestResourceLock"), - // Type: to.Ptr("Microsoft.OperationalInsights/clusters"), - // ID: to.Ptr("/subscriptions/594038b5-1093-476e-a366-482775671c11/resourcegroups/calbot-rg/providers/microsoft.operationalinsights/clusters/testresourcelock"), - // Location: to.Ptr("eastus"), - // Identity: &armoperationalinsights.Identity{ - // Type: to.Ptr(armoperationalinsights.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("356d057d-cba5-44dd-8a30-b2e547bc416b"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // Properties: &armoperationalinsights.ClusterProperties{ - // ClusterID: to.Ptr("5b02755b-5bf4-430c-9487-45502a2a7e62"), - // KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - // KeyName: to.Ptr("aztest2170cert"), - // KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - // KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - // }, - // ProvisioningState: to.Ptr(armoperationalinsights.ClusterEntityStatusSucceeded), - // }, - // SKU: &armoperationalinsights.ClusterSKU{ - // Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - // Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersCreate.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "oiautorest6685", "oiautorest6685", armoperationalinsights.Cluster{ - Location: to.Ptr("australiasoutheast"), - Tags: map[string]*string{ - "tag1": to.Ptr("val1"), - }, - SKU: &armoperationalinsights.ClusterSKU{ - Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armoperationalinsights.Cluster{ - // Name: to.Ptr("oiautorest6685"), - // Type: to.Ptr("Microsoft.OperationalInsights/clusters"), - // ID: to.Ptr("/subscriptions/594038b5-1093-476e-a366-482775671c11/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/clusters/oiautorest6685"), - // Location: to.Ptr("australiasoutheast"), - // Identity: &armoperationalinsights.Identity{ - // Type: to.Ptr(armoperationalinsights.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("356d057d-cba5-44dd-8a30-b2e547bc416b"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // Properties: &armoperationalinsights.ClusterProperties{ - // AssociatedWorkspaces: []*armoperationalinsights.AssociatedWorkspace{ - // }, - // BillingType: to.Ptr(armoperationalinsights.BillingTypeCluster), - // CapacityReservationProperties: &armoperationalinsights.CapacityReservationProperties{ - // LastSKUUpdate: to.Ptr("Thu, 01 Jan 1970 00:00:00 GMT"), - // MinCapacity: to.Ptr[int64](500), - // }, - // ClusterID: to.Ptr("1c3f2afc-9ec1-4e74-bfe8-022b83bcd7b1"), - // CreatedDate: to.Ptr("Mon, 13 Jan 2020 14:40:33 GMT"), - // KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - // KeyName: to.Ptr("aztest2170cert"), - // KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - // KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - // }, - // LastModifiedDate: to.Ptr("Sun, 04 Jan 2020 17:10:56 GMT"), - // ProvisioningState: to.Ptr(armoperationalinsights.ClusterEntityStatusSucceeded), - // }, - // SKU: &armoperationalinsights.ClusterSKU{ - // Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - // Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersDelete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "oiautorest6685", "oiautorest6685", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersGet.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "oiautorest6685", "oiautorest6685", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armoperationalinsights.Cluster{ - // Name: to.Ptr("TestResourceLock"), - // Type: to.Ptr("Microsoft.OperationalInsights/clusters"), - // ID: to.Ptr("/subscriptions/594038b5-1093-476e-a366-482775671c11/resourcegroups/calbot-rg/providers/microsoft.operationalinsights/clusters/testresourcelock"), - // Location: to.Ptr("eastus"), - // Identity: &armoperationalinsights.Identity{ - // Type: to.Ptr(armoperationalinsights.IdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("356d057d-cba5-44dd-8a30-b2e547bc416b"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // Properties: &armoperationalinsights.ClusterProperties{ - // AssociatedWorkspaces: []*armoperationalinsights.AssociatedWorkspace{ - // { - // AssociateDate: to.Ptr("Tue, 07 Jul 2020 07:35:51 GMT"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/microsoft.operationalinsights/workspaces/testWs1"), - // WorkspaceID: to.Ptr("942bdefd-e6c9-411c-ac69-70ffad564363"), - // WorkspaceName: to.Ptr("testWs1"), - // }, - // { - // AssociateDate: to.Ptr("Mon, 13 Jan 2020 16:03:39 GMT"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/microsoft.operationalinsights/workspaces/testWs2"), - // WorkspaceID: to.Ptr("c7edb8f8-67f7-41f2-bddb-aecf22507e3f"), - // WorkspaceName: to.Ptr("testWs2"), - // }}, - // BillingType: to.Ptr(armoperationalinsights.BillingTypeCluster), - // CapacityReservationProperties: &armoperationalinsights.CapacityReservationProperties{ - // LastSKUUpdate: to.Ptr("Thu, 01 Jan 1970 00:00:00 GMT"), - // MinCapacity: to.Ptr[int64](500), - // }, - // ClusterID: to.Ptr("1c3f2afc-9ec1-4e74-bfe8-022b83bcd7b1"), - // CreatedDate: to.Ptr("Mon, 13 Jan 2020 14:40:33 GMT"), - // IsAvailabilityZonesEnabled: to.Ptr(false), - // IsDoubleEncryptionEnabled: to.Ptr(false), - // KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - // KeyName: to.Ptr("aztest2170cert"), - // KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - // KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - // }, - // LastModifiedDate: to.Ptr("Sun, 04 Jan 2020 17:10:56 GMT"), - // ProvisioningState: to.Ptr(armoperationalinsights.ClusterEntityStatusSucceeded), - // }, - // SKU: &armoperationalinsights.ClusterSKU{ - // Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - // Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/ClustersUpdate.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "oiautorest6685", "oiautorest6685", armoperationalinsights.ClusterPatch{ - Identity: &armoperationalinsights.Identity{ - Type: to.Ptr(armoperationalinsights.IdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armoperationalinsights.UserIdentityProperties{ - "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}, - }, - }, - Properties: &armoperationalinsights.ClusterPatchProperties{ - KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - KeyName: to.Ptr("aztest2170cert"), - KeyRsaSize: to.Ptr[int32](1024), - KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - }, - }, - SKU: &armoperationalinsights.ClusterSKU{ - Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("val1"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armoperationalinsights.Cluster{ - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Identity: &armoperationalinsights.Identity{ - // Type: to.Ptr(armoperationalinsights.IdentityTypeUserAssigned), - // TenantID: to.Ptr("72f999bf-acf1-41af-91ab-2d7cd011db47"), - // UserAssignedIdentities: map[string]*armoperationalinsights.UserIdentityProperties{ - // "/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armoperationalinsights.UserIdentityProperties{ - // ClientID: to.Ptr("eb3a943d-6b12-48a6-b585-ac2316e15ab2"), - // PrincipalID: to.Ptr("b31776d4-ee80-4860-9433-ec0101be1891"), - // }, - // }, - // }, - // Properties: &armoperationalinsights.ClusterProperties{ - // AssociatedWorkspaces: []*armoperationalinsights.AssociatedWorkspace{ - // { - // AssociateDate: to.Ptr("Tue, 07 Jul 2020 07:35:51 GMT"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/microsoft.operationalinsights/workspaces/testWs1"), - // WorkspaceID: to.Ptr("942bdefd-e6c9-411c-ac69-70ffad564363"), - // WorkspaceName: to.Ptr("testWs1"), - // }, - // { - // AssociateDate: to.Ptr("Mon, 13 Jan 2020 16:03:39 GMT"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/testRG/providers/microsoft.operationalinsights/workspaces/testWs2"), - // WorkspaceID: to.Ptr("c7edb8f8-67f7-41f2-bddb-aecf22507e3f"), - // WorkspaceName: to.Ptr("testWs2"), - // }}, - // BillingType: to.Ptr(armoperationalinsights.BillingTypeCluster), - // CapacityReservationProperties: &armoperationalinsights.CapacityReservationProperties{ - // LastSKUUpdate: to.Ptr("Thu, 01 Jan 1970 00:00:00 GMT"), - // MinCapacity: to.Ptr[int64](500), - // }, - // ClusterID: to.Ptr("1c3f2afc-9ec1-4e74-bfe8-022b83bcd7b1"), - // CreatedDate: to.Ptr("Mon, 13 Jan 2020 14:40:33 GMT"), - // KeyVaultProperties: &armoperationalinsights.KeyVaultProperties{ - // KeyName: to.Ptr("aztest2170cert"), - // KeyVaultURI: to.Ptr("https://aztest2170.vault.azure.net"), - // KeyVersion: to.Ptr("654ft6c4e63845cbb50fd6fg51540429"), - // }, - // LastModifiedDate: to.Ptr("Sun, 04 Jan 2020 17:10:56 GMT"), - // ProvisioningState: to.Ptr(armoperationalinsights.ClusterEntityStatusSucceeded), - // }, - // SKU: &armoperationalinsights.ClusterSKU{ - // Name: to.Ptr(armoperationalinsights.ClusterSKUNameEnumCapacityReservation), - // Capacity: to.Ptr(armoperationalinsights.CapacityTenHundred), - // }, - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go index 1782aa1928c6..67fdfe7bf75d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/constants.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -10,9 +7,27 @@ package armoperationalinsights const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" - moduleVersion = "v2.0.0-beta.4" + moduleVersion = "v2.0.0" +) + +// AccessRuleDirection - Direction of Access Rule +type AccessRuleDirection string + +const ( + // AccessRuleDirectionInbound - Applies to inbound network traffic to the secured resources. + AccessRuleDirectionInbound AccessRuleDirection = "Inbound" + // AccessRuleDirectionOutbound - Applies to outbound network traffic from the secured resources + AccessRuleDirectionOutbound AccessRuleDirection = "Outbound" ) +// PossibleAccessRuleDirectionValues returns the possible values for the AccessRuleDirection const type. +func PossibleAccessRuleDirectionValues() []AccessRuleDirection { + return []AccessRuleDirection{ + AccessRuleDirectionInbound, + AccessRuleDirectionOutbound, + } +} + // BillingType - Configures whether billing will be only on the cluster or each workspace will be billed by its proportional // use. This does not change the overall billing, only how it will be distributed. Default // value is 'Cluster' @@ -31,22 +46,36 @@ func PossibleBillingTypeValues() []BillingType { } } -// Capacity - The capacity value +// Capacity - The capacity reservation level in Gigabytes for this cluster. type Capacity int64 const ( - CapacityFiveHundred Capacity = 500 - CapacityFiveThousand Capacity = 5000 - CapacityTenHundred Capacity = 1000 - CapacityTwoThousand Capacity = 2000 + CapacityFiftyThousand Capacity = 50000 + CapacityFiveHundred Capacity = 500 + CapacityFiveThousand Capacity = 5000 + CapacityFourHundred Capacity = 400 + CapacityOneHundred Capacity = 100 + CapacityTenHundred Capacity = 1000 + CapacityTenThousand Capacity = 10000 + CapacityThreeHundred Capacity = 300 + CapacityTwentyFiveThousand Capacity = 25000 + CapacityTwoHundred Capacity = 200 + CapacityTwoThousand Capacity = 2000 ) // PossibleCapacityValues returns the possible values for the Capacity const type. func PossibleCapacityValues() []Capacity { return []Capacity{ + CapacityFiftyThousand, CapacityFiveHundred, CapacityFiveThousand, + CapacityFourHundred, + CapacityOneHundred, CapacityTenHundred, + CapacityTenThousand, + CapacityThreeHundred, + CapacityTwentyFiveThousand, + CapacityTwoHundred, CapacityTwoThousand, } } @@ -55,25 +84,31 @@ func PossibleCapacityValues() []Capacity { type CapacityReservationLevel int32 const ( - CapacityReservationLevelFiveHundred CapacityReservationLevel = 500 - CapacityReservationLevelFiveThousand CapacityReservationLevel = 5000 - CapacityReservationLevelFourHundred CapacityReservationLevel = 400 - CapacityReservationLevelOneHundred CapacityReservationLevel = 100 - CapacityReservationLevelTenHundred CapacityReservationLevel = 1000 - CapacityReservationLevelThreeHundred CapacityReservationLevel = 300 - CapacityReservationLevelTwoHundred CapacityReservationLevel = 200 - CapacityReservationLevelTwoThousand CapacityReservationLevel = 2000 + CapacityReservationLevelFiftyThousand CapacityReservationLevel = 50000 + CapacityReservationLevelFiveHundred CapacityReservationLevel = 500 + CapacityReservationLevelFiveThousand CapacityReservationLevel = 5000 + CapacityReservationLevelFourHundred CapacityReservationLevel = 400 + CapacityReservationLevelOneHundred CapacityReservationLevel = 100 + CapacityReservationLevelTenHundred CapacityReservationLevel = 1000 + CapacityReservationLevelTenThousand CapacityReservationLevel = 10000 + CapacityReservationLevelThreeHundred CapacityReservationLevel = 300 + CapacityReservationLevelTwentyFiveThousand CapacityReservationLevel = 25000 + CapacityReservationLevelTwoHundred CapacityReservationLevel = 200 + CapacityReservationLevelTwoThousand CapacityReservationLevel = 2000 ) // PossibleCapacityReservationLevelValues returns the possible values for the CapacityReservationLevel const type. func PossibleCapacityReservationLevelValues() []CapacityReservationLevel { return []CapacityReservationLevel{ + CapacityReservationLevelFiftyThousand, CapacityReservationLevelFiveHundred, CapacityReservationLevelFiveThousand, CapacityReservationLevelFourHundred, CapacityReservationLevelOneHundred, CapacityReservationLevelTenHundred, + CapacityReservationLevelTenThousand, CapacityReservationLevelThreeHundred, + CapacityReservationLevelTwentyFiveThousand, CapacityReservationLevelTwoHundred, CapacityReservationLevelTwoThousand, } @@ -105,7 +140,37 @@ func PossibleClusterEntityStatusValues() []ClusterEntityStatus { } } -// ClusterSKUNameEnum - The name of the SKU. +// ClusterReplicationState - The provisioning state of the cluster replication. +type ClusterReplicationState string + +const ( + ClusterReplicationStateCanceled ClusterReplicationState = "Canceled" + ClusterReplicationStateDisableRequested ClusterReplicationState = "DisableRequested" + ClusterReplicationStateDisabling ClusterReplicationState = "Disabling" + ClusterReplicationStateEnableRequested ClusterReplicationState = "EnableRequested" + ClusterReplicationStateEnabling ClusterReplicationState = "Enabling" + ClusterReplicationStateFailed ClusterReplicationState = "Failed" + ClusterReplicationStateRollbackRequested ClusterReplicationState = "RollbackRequested" + ClusterReplicationStateRollingBack ClusterReplicationState = "RollingBack" + ClusterReplicationStateSucceeded ClusterReplicationState = "Succeeded" +) + +// PossibleClusterReplicationStateValues returns the possible values for the ClusterReplicationState const type. +func PossibleClusterReplicationStateValues() []ClusterReplicationState { + return []ClusterReplicationState{ + ClusterReplicationStateCanceled, + ClusterReplicationStateDisableRequested, + ClusterReplicationStateDisabling, + ClusterReplicationStateEnableRequested, + ClusterReplicationStateEnabling, + ClusterReplicationStateFailed, + ClusterReplicationStateRollbackRequested, + ClusterReplicationStateRollingBack, + ClusterReplicationStateSucceeded, + } +} + +// ClusterSKUNameEnum - The SKU (tier) of a cluster. type ClusterSKUNameEnum string const ( @@ -321,32 +386,51 @@ func PossibleDataSourceTypeValues() []DataSourceType { } } -// IdentityType - The type of identity that creates/modifies resources +// IdentityType - Type of managed service identity. type IdentityType string const ( - IdentityTypeApplication IdentityType = "application" - IdentityTypeKey IdentityType = "key" - IdentityTypeManagedIdentity IdentityType = "managedIdentity" - IdentityTypeNone IdentityType = "None" - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" - IdentityTypeUser IdentityType = "user" - IdentityTypeUserAssigned IdentityType = "UserAssigned" + IdentityTypeNone IdentityType = "None" + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ - IdentityTypeApplication, - IdentityTypeKey, - IdentityTypeManagedIdentity, IdentityTypeNone, IdentityTypeSystemAssigned, - IdentityTypeUser, IdentityTypeUserAssigned, } } +// IssueType - Type of issue +type IssueType string + +const ( + // IssueTypeConfigurationPropagationFailure - An error occurred while applying the network security perimeter (NSP) configuration. + IssueTypeConfigurationPropagationFailure IssueType = "ConfigurationPropagationFailure" + // IssueTypeMissingIdentityConfiguration - An managed identity hasn't been associated with the resource. The resource will + // still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but + // it won't be able to perform outbound access as a member of the NSP. + IssueTypeMissingIdentityConfiguration IssueType = "MissingIdentityConfiguration" + // IssueTypeMissingPerimeterConfiguration - A network connectivity issue is happening on the resource which could be addressed + // either by adding new resources to the network security perimeter (NSP) or by modifying access rules. + IssueTypeMissingPerimeterConfiguration IssueType = "MissingPerimeterConfiguration" + // IssueTypeUnknown - Unknown issue type + IssueTypeUnknown IssueType = "Unknown" +) + +// PossibleIssueTypeValues returns the possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{ + IssueTypeConfigurationPropagationFailure, + IssueTypeMissingIdentityConfiguration, + IssueTypeMissingPerimeterConfiguration, + IssueTypeUnknown, + } +} + // LinkedServiceEntityStatus - The provisioning state of the linked service. type LinkedServiceEntityStatus string @@ -367,11 +451,60 @@ func PossibleLinkedServiceEntityStatusValues() []LinkedServiceEntityStatus { } } +// ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeUserAssigned, + } +} + +// NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of a network security perimeter configuration +// that is being created or updated. +type NetworkSecurityPerimeterConfigurationProvisioningState string + +const ( + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" + NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" + NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" +) + +// PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type. +func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState { + return []NetworkSecurityPerimeterConfigurationProvisioningState{ + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted, + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled, + NetworkSecurityPerimeterConfigurationProvisioningStateCreating, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting, + NetworkSecurityPerimeterConfigurationProvisioningStateFailed, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded, + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating, + } +} + // ProvisioningStateEnum - Table's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing // operation, forbidding any update to the table until the ongoing operation is concluded. type ProvisioningStateEnum string const ( + // ProvisioningStateEnumDeleting - Table state is deleting. + ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" // ProvisioningStateEnumInProgress - Table schema is stable and without changes, table data is being updated. ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" // ProvisioningStateEnumSucceeded - Table state is stable and without changes, table is unlocked and open for new updates. @@ -384,6 +517,7 @@ const ( // PossibleProvisioningStateEnumValues returns the possible values for the ProvisioningStateEnum const type. func PossibleProvisioningStateEnumValues() []ProvisioningStateEnum { return []ProvisioningStateEnum{ + ProvisioningStateEnumDeleting, ProvisioningStateEnumInProgress, ProvisioningStateEnumSucceeded, ProvisioningStateEnumUpdating, @@ -424,6 +558,29 @@ func PossiblePurgeStateValues() []PurgeState { } } +// ResourceAssociationAccessMode - Access mode of the resource association +type ResourceAssociationAccessMode string + +const ( + // ResourceAssociationAccessModeAudit - Audit access mode - traffic to the resource that fails access checks is logged but + // not blocked + ResourceAssociationAccessModeAudit ResourceAssociationAccessMode = "Audit" + // ResourceAssociationAccessModeEnforced - Enforced access mode - traffic to the resource that failed access checks is blocked + ResourceAssociationAccessModeEnforced ResourceAssociationAccessMode = "Enforced" + // ResourceAssociationAccessModeLearning - Learning access mode - traffic to the resource is enabled for analysis but not + // blocked + ResourceAssociationAccessModeLearning ResourceAssociationAccessMode = "Learning" +) + +// PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type. +func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode { + return []ResourceAssociationAccessMode{ + ResourceAssociationAccessModeAudit, + ResourceAssociationAccessModeEnforced, + ResourceAssociationAccessModeLearning, + } +} + // SKUNameEnum - The name of the Service Tier. type SKUNameEnum string @@ -466,6 +623,22 @@ func PossibleSearchSortEnumValues() []SearchSortEnum { } } +// Severity - Severity of the issue. +type Severity string + +const ( + SeverityError Severity = "Error" + SeverityWarning Severity = "Warning" +) + +// PossibleSeverityValues returns the possible values for the Severity const type. +func PossibleSeverityValues() []Severity { + return []Severity{ + SeverityError, + SeverityWarning, + } +} + // SourceEnum - Table's creator. type SourceEnum string @@ -610,6 +783,58 @@ func PossibleWorkspaceEntityStatusValues() []WorkspaceEntityStatus { } } +// WorkspaceFailoverState - The failover state of the replication. +type WorkspaceFailoverState string + +const ( + WorkspaceFailoverStateActivating WorkspaceFailoverState = "Activating" + WorkspaceFailoverStateActive WorkspaceFailoverState = "Active" + WorkspaceFailoverStateDeactivating WorkspaceFailoverState = "Deactivating" + WorkspaceFailoverStateFailed WorkspaceFailoverState = "Failed" + WorkspaceFailoverStateInactive WorkspaceFailoverState = "Inactive" +) + +// PossibleWorkspaceFailoverStateValues returns the possible values for the WorkspaceFailoverState const type. +func PossibleWorkspaceFailoverStateValues() []WorkspaceFailoverState { + return []WorkspaceFailoverState{ + WorkspaceFailoverStateActivating, + WorkspaceFailoverStateActive, + WorkspaceFailoverStateDeactivating, + WorkspaceFailoverStateFailed, + WorkspaceFailoverStateInactive, + } +} + +// WorkspaceReplicationState - The provisioning state of the replication. +type WorkspaceReplicationState string + +const ( + WorkspaceReplicationStateCanceled WorkspaceReplicationState = "Canceled" + WorkspaceReplicationStateDisableRequested WorkspaceReplicationState = "DisableRequested" + WorkspaceReplicationStateDisabling WorkspaceReplicationState = "Disabling" + WorkspaceReplicationStateEnableRequested WorkspaceReplicationState = "EnableRequested" + WorkspaceReplicationStateEnabling WorkspaceReplicationState = "Enabling" + WorkspaceReplicationStateFailed WorkspaceReplicationState = "Failed" + WorkspaceReplicationStateRollbackRequested WorkspaceReplicationState = "RollbackRequested" + WorkspaceReplicationStateRollingBack WorkspaceReplicationState = "RollingBack" + WorkspaceReplicationStateSucceeded WorkspaceReplicationState = "Succeeded" +) + +// PossibleWorkspaceReplicationStateValues returns the possible values for the WorkspaceReplicationState const type. +func PossibleWorkspaceReplicationStateValues() []WorkspaceReplicationState { + return []WorkspaceReplicationState{ + WorkspaceReplicationStateCanceled, + WorkspaceReplicationStateDisableRequested, + WorkspaceReplicationStateDisabling, + WorkspaceReplicationStateEnableRequested, + WorkspaceReplicationStateEnabling, + WorkspaceReplicationStateFailed, + WorkspaceReplicationStateRollbackRequested, + WorkspaceReplicationStateRollingBack, + WorkspaceReplicationStateSucceeded, + } +} + // WorkspaceSKUNameEnum - The name of the SKU. type WorkspaceSKUNameEnum string diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go index 1c54624d93d0..38b94cf7ff61 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDataExportsClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Create or update a data export. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataExportName - The data export rule name. @@ -76,7 +73,7 @@ func (client *DataExportsClient) CreateOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataExportsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, parameters DataExport, options *DataExportsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataExportsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, parameters DataExport, _ *DataExportsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -99,7 +96,7 @@ func (client *DataExportsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +117,7 @@ func (client *DataExportsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes the specified data export in a given workspace.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataExportName - The data export rule name. @@ -147,7 +144,7 @@ func (client *DataExportsClient) Delete(ctx context.Context, resourceGroupName s } // deleteCreateRequest creates the Delete request. -func (client *DataExportsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, options *DataExportsClientDeleteOptions) (*policy.Request, error) { +func (client *DataExportsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, _ *DataExportsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -170,7 +167,7 @@ func (client *DataExportsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +176,7 @@ func (client *DataExportsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets a data export instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataExportName - The data export rule name. @@ -207,7 +204,7 @@ func (client *DataExportsClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *DataExportsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, options *DataExportsClientGetOptions) (*policy.Request, error) { +func (client *DataExportsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, _ *DataExportsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -230,7 +227,7 @@ func (client *DataExportsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +244,7 @@ func (client *DataExportsClient) getHandleResponse(resp *http.Response) (DataExp // NewListByWorkspacePager - Lists the data export instances within a workspace. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - DataExportsClientListByWorkspaceOptions contains the optional parameters for the DataExportsClient.NewListByWorkspacePager @@ -277,7 +274,7 @@ func (client *DataExportsClient) NewListByWorkspacePager(resourceGroupName strin } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *DataExportsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *DataExportsClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *DataExportsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *DataExportsClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -296,7 +293,7 @@ func (client *DataExportsClient) listByWorkspaceCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client_example_test.go deleted file mode 100644 index 54fafba50429..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/dataexports_client_example_test.go +++ /dev/null @@ -1,163 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportListByWorkspace.json -func ExampleDataExportsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataExportsClient().NewListByWorkspacePager("RgTest1", "DeWnTest1234", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataExportListResult = armoperationalinsights.DataExportListResult{ - // Value: []*armoperationalinsights.DataExport{ - // { - // Name: to.Ptr("export1"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/export"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1"), - // Properties: &armoperationalinsights.DataExportProperties{ - // CreatedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // DataExportID: to.Ptr("d5233afc-7829-4b89-c594-08d7975e19a5"), - // Destination: &armoperationalinsights.Destination{ - // Type: to.Ptr(armoperationalinsights.TypeEventHub), - // ResourceID: to.Ptr("/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test"), - // }, - // Enable: to.Ptr(true), - // LastModifiedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // TableNames: []*string{ - // to.Ptr("Heartbeat")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportCreateOrUpdate.json -func ExampleDataExportsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataExportsClient().CreateOrUpdate(ctx, "RgTest1", "DeWnTest1234", "export1", armoperationalinsights.DataExport{ - Properties: &armoperationalinsights.DataExportProperties{ - Destination: &armoperationalinsights.Destination{ - ResourceID: to.Ptr("/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test"), - }, - TableNames: []*string{ - to.Ptr("Heartbeat")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataExport = armoperationalinsights.DataExport{ - // Name: to.Ptr("export1"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/export"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1"), - // Properties: &armoperationalinsights.DataExportProperties{ - // CreatedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // DataExportID: to.Ptr("d5233afc-7829-4b89-c594-08d7975e19a5"), - // Destination: &armoperationalinsights.Destination{ - // Type: to.Ptr(armoperationalinsights.TypeEventHub), - // ResourceID: to.Ptr("/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test"), - // }, - // Enable: to.Ptr(true), - // LastModifiedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // TableNames: []*string{ - // to.Ptr("Heartbeat")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportGet.json -func ExampleDataExportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataExportsClient().Get(ctx, "RgTest1", "DeWnTest1234", "export1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataExport = armoperationalinsights.DataExport{ - // Name: to.Ptr("export1"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/export"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/RgTest1/providers/microsoft.operationalinsights/workspaces/DeWnTest1234/export/export1"), - // Properties: &armoperationalinsights.DataExportProperties{ - // CreatedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // DataExportID: to.Ptr("d5233afc-7829-4b89-c594-08d7975e19a5"), - // Destination: &armoperationalinsights.Destination{ - // Type: to.Ptr(armoperationalinsights.TypeEventHub), - // ResourceID: to.Ptr("/subscriptions/192b9f85-a39a-4276-b96d-d5cd351703f9/resourceGroups/OIAutoRest1234/providers/Microsoft.EventHub/namespaces/test"), - // }, - // Enable: to.Ptr(true), - // LastModifiedDate: to.Ptr("Sun, 12 Jan 2020 12:51:10 GMT"), - // TableNames: []*string{ - // to.Ptr("Heartbeat")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportDelete.json -func ExampleDataExportsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataExportsClient().Delete(ctx, "RgTest1", "DeWnTest1234", "export1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go index 877f4bce1b05..21e74134e8fd 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDataSourcesClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Create or update a data source. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceName - The name of the datasource resource. @@ -76,7 +73,7 @@ func (client *DataSourcesClient) CreateOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataSourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters DataSource, options *DataSourcesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataSourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters DataSource, _ *DataSourcesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *DataSourcesClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +117,7 @@ func (client *DataSourcesClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes a data source instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceName - Name of the datasource. @@ -147,7 +144,7 @@ func (client *DataSourcesClient) Delete(ctx context.Context, resourceGroupName s } // deleteCreateRequest creates the Delete request. -func (client *DataSourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, options *DataSourcesClientDeleteOptions) (*policy.Request, error) { +func (client *DataSourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, _ *DataSourcesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -170,7 +167,7 @@ func (client *DataSourcesClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -178,7 +175,7 @@ func (client *DataSourcesClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets a datasource instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceName - Name of the datasource @@ -206,7 +203,7 @@ func (client *DataSourcesClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *DataSourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, options *DataSourcesClientGetOptions) (*policy.Request, error) { +func (client *DataSourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, _ *DataSourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -229,7 +226,7 @@ func (client *DataSourcesClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +243,7 @@ func (client *DataSourcesClient) getHandleResponse(resp *http.Response) (DataSou // NewListByWorkspacePager - Gets the first page of data source instances in a workspace with the link to the next page. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - filter - The filter to apply on the operation. @@ -299,7 +296,7 @@ func (client *DataSourcesClient) listByWorkspaceCreateRequest(ctx context.Contex if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client_example_test.go deleted file mode 100644 index bdada8921b82..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/datasources_client_example_test.go +++ /dev/null @@ -1,3129 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesCreate.json -func ExampleDataSourcesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataSourcesClient().CreateOrUpdate(ctx, "OIAutoRest5123", "AzTest9724", "AzTestDS774", armoperationalinsights.DataSource{ - Kind: to.Ptr(armoperationalinsights.DataSourceKindAzureActivityLog), - Properties: map[string]any{ - "LinkedResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/providers/microsoft.insights/eventtypes/management", - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataSource = armoperationalinsights.DataSource{ - // Name: to.Ptr("AzTestDS774"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/AzTest9724/datasources/AzTestDS774"), - // Etag: to.Ptr("W/\"datetime'2017-10-01T08%3A01%3A21.2351243Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindAzureActivityLog), - // Properties: map[string]any{ - // "linkedResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/providers/microsoft.insights/eventtypes/management", - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesDelete.json -func ExampleDataSourcesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataSourcesClient().Delete(ctx, "OIAutoRest5123", "AzTest9724", "AzTestDS774", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesGet.json -func ExampleDataSourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataSourcesClient().Get(ctx, "OIAutoRest5123", "AzTest9724", "AzTestDS774", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DataSource = armoperationalinsights.DataSource{ - // Name: to.Ptr("AzTestDS774"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest5123/providers/Microsoft.OperationalInsights/workspaces/AzTest9724/datasources/AzTestDS774"), - // Etag: to.Ptr("W/\"datetime'2017-10-01T08%3A01%3A21.2351243Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindAzureActivityLog), - // Properties: map[string]any{ - // "linkedResourceId": "/subscriptions/00000000-0000-0000-0000-00000000000/providers/microsoft.insights/eventtypes/management", - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesListByWorkspace.json -func ExampleDataSourcesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataSourcesClient().NewListByWorkspacePager("OIAutoRest5123", "AzTest9724", "kind='WindowsEvent'", &armoperationalinsights.DataSourcesClientListByWorkspaceOptions{Skiptoken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DataSourceListResult = armoperationalinsights.DataSourceListResult{ - // Value: []*armoperationalinsights.DataSource{ - // { - // Name: to.Ptr("AzTestDSWE1011"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1011"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A08.5629323Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent14", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1013"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1013"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A22.2533211Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent64", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1020"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1020"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A04.4645698Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent202", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1074"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1074"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A12.5871672Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent231", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1117"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1117"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A28.9325389Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent86", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1128"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1128"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A13.2185735Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent30", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1176"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1176"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A22.7779289Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent66", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1293"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1293"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A03.5114136Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent199", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE134"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE134"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A33.6788897Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent102", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1352"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1352"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A36.2312139Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent111", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1360"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1360"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A13.4685716Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent31", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1382"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1382"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A19.2840543Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent53", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1410"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1410"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A42.7070374Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent132", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1417"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1417"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A06.8922838Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent211", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1560"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1560"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A26.6932412Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent274", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1618"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1618"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A07.1422661Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent212", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1662"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1662"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A09.5980265Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent221", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1675"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1675"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A39.6167744Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent121", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE169"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE169"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A50.1064668Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent157", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1735"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1735"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A02.4954752Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent196", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1742"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1742"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A08.0452997Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent12", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1815"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1815"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A46.5966089Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent145", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1828"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1828"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A23.6529754Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent69", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE188"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE188"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A20.7216320Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent58", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1962"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1962"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A17.9341560Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent48", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE1997"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE1997"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A17.3081821Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent246", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2046"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2046"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A49.2918213Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent154", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2056"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2056"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A52.4111189Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent165", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2116"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2116"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A54.7598026Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent172", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2142"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2142"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A07.2711237Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent9", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE22"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE22"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A48.2064500Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent150", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2208"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2208"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A08.7849248Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent218", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2221"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2221"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A51.3306230Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent161", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2226"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2226"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A25.5991266Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent75", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2231"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2231"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A15.3592513Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent38", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2242"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2242"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A06.0641077Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent208", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2263"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2263"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A11.7829226Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent228", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2369"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2369"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A21.5874093Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent259", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE240"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE240"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A06.6266574Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent210", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2423"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2423"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A23.4752361Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent265", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2463"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2463"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A36.5611370Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent112", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2499"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2499"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A13.7187131Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent32", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2509"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2509"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A09.3324224Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent220", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2541"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2541"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A29.2312540Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent87", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2578"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2578"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A05.3117461Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent2", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2619"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2619"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A38.5379572Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent119", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE274"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE274"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A05.0735592Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent1", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2754"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2754"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A30.6297451Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent92", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE281"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE281"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A05.2972963Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent205", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2818"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2818"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A33.3820072Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent101", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2860"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2860"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A14.0876077Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent236", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2867"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2867"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A30.9266089Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent93", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2923"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2923"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A27.9342580Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent278", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE2979"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE2979"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A44.4311007Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent138", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3009"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3009"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A08.5349323Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent217", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3033"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3033"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A24.9696296Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent269", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3095"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3095"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A18.2006423Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent49", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3114"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3114"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A38.2879169Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent118", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3132"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3132"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A37.6889867Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent116", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3147"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3147"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A58.9331954Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent185", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3159"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3159"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A35.6843083Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent109", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE317"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE317"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A17.4118415Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent46", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3175"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3175"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A35.0592573Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent107", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3183"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3183"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A12.6247906Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent28", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3217"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3217"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A14.4938899Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent237", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3220"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3220"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A21.7373059Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent62", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3228"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3228"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A18.7785353Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent51", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3395"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3395"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A54.4936956Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent171", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3416"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3416"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A22.0032694Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent63", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3506"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3506"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A28.8251658Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent280", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3517"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3517"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A11.2153209Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent23", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3528"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3528"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A12.0402565Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent229", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3530"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3530"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A43.8027590Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent136", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3594"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3594"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A01.9173304Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent194", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3615"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3615"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A00.8990889Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent191", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3645"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3645"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A16.0877829Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent242", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3676"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3676"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A07.8068460Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent11", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3700"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3700"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A49.5439700Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent155", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3738"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3738"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A38.0363694Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent117", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3740"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3740"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A50.6390339Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent159", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3754"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3754"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A31.5203823Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent95", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3761"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3761"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A31.7860159Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent96", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3787"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3787"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A20.0966078Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent56", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3880"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3880"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A57.8394298Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent181", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3887"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3887"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A51.0806178Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent160", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3899"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3899"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A16.6987634Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent244", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE3928"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE3928"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A41.4223363Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent127", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4005"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4005"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A59.1831854Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent186", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4021"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4021"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A31.5314824Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent288", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4054"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4054"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A01.6667691Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent193", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE406"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE406"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A42.9581303Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent133", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4128"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4128"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A29.4890798Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent88", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4140"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4140"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A00.2051432Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent189", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4209"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4209"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A58.3706603Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent183", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4216"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4216"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A23.1240354Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent67", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4240"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4240"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A33.5368097Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent294", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4279"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4279"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A30.3641074Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent91", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4289"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4289"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A26.3963554Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent273", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4317"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4317"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A47.6751803Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent148", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4324"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4324"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A05.8120517Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent4", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4362"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4362"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A04.1208323Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent201", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4416"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4416"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A08.3109506Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent13", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4424"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4424"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A48.9744951Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent153", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4466"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4466"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A19.0457713Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent52", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4467"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4467"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A15.0936374Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent37", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4503"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4503"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A41.9399246Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent129", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4521"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4521"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A27.2714771Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent276", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4530"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4530"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A26.7419933Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent79", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4600"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4600"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A37.4227966Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent115", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4644"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4644"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A43.5519204Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent135", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4694"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4694"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A51.6431386Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent162", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4715"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4715"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A06.0530002Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent5", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE472"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE472"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A24.3989962Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent267", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4721"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4721"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A16.3706498Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent243", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4734"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4734"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A33.8337155Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent295", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4755"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4755"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A25.2712759Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent270", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4779"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4779"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A27.5076680Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent81", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4791"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4791"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A04.6828938Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent0", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4798"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4798"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A54.0073520Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent170", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE480"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE480"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A22.9077505Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent263", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4847"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4847"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A11.7028912Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent25", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4876"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4876"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A04.9847854Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent204", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4900"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4900"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A23.4029367Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent68", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4918"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4918"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A34.5280091Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent105", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4928"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4928"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A34.2882196Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent296", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4930"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4930"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A33.2381803Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent293", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4945"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4945"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A36.8423994Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent113", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4967"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4967"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A08.9379456Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent15", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4969"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4969"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A57.5893926Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent180", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE4983"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE4983"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A19.5497139Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent54", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5011"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5011"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A48.4588661Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent151", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5082"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5082"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A32.2694295Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent290", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5136"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5136"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A17.8863220Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent248", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5141"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5141"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A05.5484906Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent206", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5166"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5166"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A23.9283342Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent266", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5207"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5207"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A29.4970655Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent282", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5223"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5223"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A04.7146038Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent203", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5233"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5233"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A10.3237629Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent20", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5253"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5253"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A18.1831872Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent249", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5255"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5255"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A30.9049829Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent286", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5263"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5263"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A12.8904269Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent29", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5351"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5351"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A20.4543884Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent255", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5385"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5385"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A19.7997319Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent55", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5394"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5394"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A29.7703365Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent89", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE541"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE541"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A09.4692151Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent17", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5439"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5439"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A15.7994161Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent241", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5460"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5460"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A10.3032105Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent223", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5479"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5479"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A24.6802546Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent268", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5483"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5483"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A01.1670463Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent192", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5486"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5486"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A37.1393156Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent114", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5554"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5554"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A41.1205470Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent126", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5559"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5559"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A20.7200407Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent256", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5585"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5585"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A18.4534330Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent50", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE568"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE568"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A40.8861587Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent125", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5741"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5741"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A12.3059271Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent230", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE58"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE58"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A39.0692471Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent120", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5810"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5810"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A16.9117573Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent44", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5815"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5815"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A45.4055476Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent141", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5858"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5858"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A55.0097893Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent173", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5866"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5866"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A18.9931389Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent251", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5888"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5888"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A59.4332080Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent187", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE5905"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE5905"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A09.7599986Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent18", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6027"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6027"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A10.6395291Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent224", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE607"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE607"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A13.7282386Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent235", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6099"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6099"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A33.1319662Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent100", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6122"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6122"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A06.3186640Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent6", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6218"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6218"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A11.4528829Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent24", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE622"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE622"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A47.9407875Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent149", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6222"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6222"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A06.3453921Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent209", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6240"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6240"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A21.2372832Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent60", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6251"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6251"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A08.2849036Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent216", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6274"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6274"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A02.1829375Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent195", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6296"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6296"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A32.3491070Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent98", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6301"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6301"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A22.1811938Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent261", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6404"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6404"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A06.7093003Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent7", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6406"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6406"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A05.5617435Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent3", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6432"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6432"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A40.2886854Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent123", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6439"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6439"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A35.9811949Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent110", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6451"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6451"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A13.1344490Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent233", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6486"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6486"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A10.9653354Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent22", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6505"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6505"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A10.0582011Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent19", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6514"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6514"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A52.8955201Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent166", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6518"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6518"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A10.9395226Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent225", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6537"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6537"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A24.0123335Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent70", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6547"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6547"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A57.3394082Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent179", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6556"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6556"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A33.9457044Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent103", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6718"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6718"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A13.4313542Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent234", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6724"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6724"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A35.4186784Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent108", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6741"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6741"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A12.3279180Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent27", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6796"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6796"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A24.5764501Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent72", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6826"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6826"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A35.2579899Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent299", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6829"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6829"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A34.6319483Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent297", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6893"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6893"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A28.5887776Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent85", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE6974"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE6974"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A16.1249736Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent41", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7008"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7008"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A28.3876585Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent279", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7014"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7014"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A29.1220764Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent281", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7068"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7068"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A26.0213457Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent272", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7080"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7080"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A21%3A21.8686663Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent260", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7166"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7166"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A40.5423724Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent124", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("AzTestDSWE7178"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/OIAutoRest7887/providers/Microsoft.OperationalInsights/workspaces/AzTest218/datasources/AzTestDSWE7178"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A20%3A16.3906307Z'\""), - // Kind: to.Ptr(armoperationalinsights.DataSourceKindWindowsEvent), - // Properties: map[string]any{ - // "eventLogName": "windowsEvent42", - // "eventTypes":[]any{ - // map[string]any{ - // "eventType": "Error", - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go index f986ec19c578..f1febc8a705b 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewDeletedWorkspacesClient(subscriptionID string, credential azcore.TokenCr // NewListPager - Gets recently deleted workspaces in a subscription, available for recovery. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - options - DeletedWorkspacesClientListOptions contains the optional parameters for the DeletedWorkspacesClient.NewListPager // method. func (client *DeletedWorkspacesClient) NewListPager(options *DeletedWorkspacesClientListOptions) *runtime.Pager[DeletedWorkspacesClientListResponse] { @@ -73,7 +70,7 @@ func (client *DeletedWorkspacesClient) NewListPager(options *DeletedWorkspacesCl } // listCreateRequest creates the List request. -func (client *DeletedWorkspacesClient) listCreateRequest(ctx context.Context, options *DeletedWorkspacesClientListOptions) (*policy.Request, error) { +func (client *DeletedWorkspacesClient) listCreateRequest(ctx context.Context, _ *DeletedWorkspacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,7 +81,7 @@ func (client *DeletedWorkspacesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -101,7 +98,7 @@ func (client *DeletedWorkspacesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Gets recently deleted workspaces in a resource group, available for recovery. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - DeletedWorkspacesClientListByResourceGroupOptions contains the optional parameters for the DeletedWorkspacesClient.NewListByResourceGroupPager // method. @@ -130,7 +127,7 @@ func (client *DeletedWorkspacesClient) NewListByResourceGroupPager(resourceGroup } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *DeletedWorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DeletedWorkspacesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *DeletedWorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *DeletedWorkspacesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -145,7 +142,7 @@ func (client *DeletedWorkspacesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client_example_test.go deleted file mode 100644 index ccfb1fd2768d..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/deletedworkspaces_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesSubscriptionList.json -func ExampleDeletedWorkspacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedWorkspacesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armoperationalinsights.WorkspaceListResult{ - // Value: []*armoperationalinsights.Workspace{ - // { - // Name: to.Ptr("AzTest2170"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // CustomerID: to.Ptr("bc089d7b-485c-4aff-a71e-c00f362d8d2f"), - // ProvisioningState: to.Ptr(armoperationalinsights.WorkspaceEntityStatusSucceeded), - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesListByResourceGroup.json -func ExampleDeletedWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedWorkspacesClient().NewListByResourceGroupPager("oiautorest6685", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armoperationalinsights.WorkspaceListResult{ - // Value: []*armoperationalinsights.Workspace{ - // { - // Name: to.Ptr("AzTest2170"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // CustomerID: to.Ptr("bc089d7b-485c-4aff-a71e-c00f362d8d2f"), - // ProvisioningState: to.Ptr(armoperationalinsights.WorkspaceEntityStatusSucceeded), - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/availableservicetiers_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/availableservicetiers_server.go index 4a4fbc5b23ee..2ce3a43dfa73 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/availableservicetiers_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/availableservicetiers_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (a *AvailableServiceTiersServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableServiceTiersClient.ListByWorkspace": - resp, err = a.dispatchListByWorkspace(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableServiceTiersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableServiceTiersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableServiceTiersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableServiceTiersClient.ListByWorkspace": + res.resp, res.err = a.dispatchListByWorkspace(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableServiceTiersServerTransport) dispatchListByWorkspace(req *http.Request) (*http.Response, error) { @@ -98,3 +114,9 @@ func (a *AvailableServiceTiersServerTransport) dispatchListByWorkspace(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableServiceTiersServerTransport +var availableServiceTiersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/clusters_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/clusters_server.go index 69b726aae65f..79769a5b9fdc 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/clusters_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/clusters_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -25,7 +22,7 @@ import ( // ClustersServer is a fake server for instances of the armoperationalinsights.ClustersClient type. type ClustersServer struct { // BeginCreateOrUpdate is the fake for method ClustersClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, clusterName string, parameters armoperationalinsights.Cluster, options *armoperationalinsights.ClustersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoperationalinsights.ClustersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method ClustersClient.BeginDelete @@ -82,31 +79,50 @@ func (c *ClustersServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ClustersClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ClustersClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ClustersClient.Get": - resp, err = c.dispatchGet(req) - case "ClustersClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ClustersClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ClustersClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ClustersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if clustersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = clustersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ClustersClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ClustersClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ClustersClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ClustersClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "ClustersClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ClustersClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -146,9 +162,9 @@ func (c *ClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) return nil, err } - if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { c.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } if !server.PollerResponderMore(beginCreateOrUpdate) { c.beginCreateOrUpdate.remove(req) @@ -351,3 +367,9 @@ func (c *ClustersServerTransport) dispatchBeginUpdate(req *http.Request) (*http. return resp, nil } + +// set this to conditionally intercept incoming requests to ClustersServerTransport +var clustersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/dataexports_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/dataexports_server.go index 6eadf7f5a8d1..6f829798c988 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/dataexports_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/dataexports_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -65,27 +62,46 @@ func (d *DataExportsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DataExportsClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DataExportsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DataExportsClient.Get": - resp, err = d.dispatchGet(req) - case "DataExportsClient.NewListByWorkspacePager": - resp, err = d.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DataExportsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dataExportsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dataExportsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DataExportsClient.CreateOrUpdate": + res.resp, res.err = d.dispatchCreateOrUpdate(req) + case "DataExportsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DataExportsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DataExportsClient.NewListByWorkspacePager": + res.resp, res.err = d.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DataExportsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -240,3 +256,9 @@ func (d *DataExportsServerTransport) dispatchNewListByWorkspacePager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to DataExportsServerTransport +var dataExportsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/datasources_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/datasources_server.go index 09b46a52d08e..58af73c6c8f8 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/datasources_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/datasources_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (d *DataSourcesServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DataSourcesClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DataSourcesClient.Delete": - resp, err = d.dispatchDelete(req) - case "DataSourcesClient.Get": - resp, err = d.dispatchGet(req) - case "DataSourcesClient.NewListByWorkspacePager": - resp, err = d.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DataSourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if dataSourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = dataSourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DataSourcesClient.CreateOrUpdate": + res.resp, res.err = d.dispatchCreateOrUpdate(req) + case "DataSourcesClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DataSourcesClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DataSourcesClient.NewListByWorkspacePager": + res.resp, res.err = d.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DataSourcesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -260,3 +276,9 @@ func (d *DataSourcesServerTransport) dispatchNewListByWorkspacePager(req *http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to DataSourcesServerTransport +var dataSourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/deletedworkspaces_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/deletedworkspaces_server.go index 09d9a77b2682..44f39749f24f 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/deletedworkspaces_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/deletedworkspaces_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (d *DeletedWorkspacesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DeletedWorkspacesClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DeletedWorkspacesClient.NewListByResourceGroupPager": - resp, err = d.dispatchNewListByResourceGroupPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DeletedWorkspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if deletedWorkspacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = deletedWorkspacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DeletedWorkspacesClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DeletedWorkspacesClient.NewListByResourceGroupPager": + res.resp, res.err = d.dispatchNewListByResourceGroupPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DeletedWorkspacesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -140,3 +156,9 @@ func (d *DeletedWorkspacesServerTransport) dispatchNewListByResourceGroupPager(r } return resp, nil } + +// set this to conditionally intercept incoming requests to DeletedWorkspacesServerTransport +var deletedWorkspacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/gateways_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/gateways_server.go index 45cd5e66cad2..0021be303dc6 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/gateways_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/gateways_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (g *GatewaysServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GatewaysClient.Delete": - resp, err = g.dispatchDelete(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GatewaysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gatewaysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gatewaysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GatewaysClient.Delete": + res.resp, res.err = g.dispatchDelete(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GatewaysServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (g *GatewaysServerTransport) dispatchDelete(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to GatewaysServerTransport +var gatewaysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/intelligencepacks_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/intelligencepacks_server.go index 8a64b3ca2c56..0aa942598db8 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/intelligencepacks_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/intelligencepacks_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -57,25 +54,44 @@ func (i *IntelligencePacksServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "IntelligencePacksClient.Disable": - resp, err = i.dispatchDisable(req) - case "IntelligencePacksClient.Enable": - resp, err = i.dispatchEnable(req) - case "IntelligencePacksClient.List": - resp, err = i.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return i.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (i *IntelligencePacksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if intelligencePacksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = intelligencePacksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IntelligencePacksClient.Disable": + res.resp, res.err = i.dispatchDisable(req) + case "IntelligencePacksClient.Enable": + res.resp, res.err = i.dispatchEnable(req) + case "IntelligencePacksClient.List": + res.resp, res.err = i.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (i *IntelligencePacksServerTransport) dispatchDisable(req *http.Request) (*http.Response, error) { @@ -184,3 +200,9 @@ func (i *IntelligencePacksServerTransport) dispatchList(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to IntelligencePacksServerTransport +var intelligencePacksServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/internal.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/internal.go index 72f540f217a1..d186c1b38a18 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/internal.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/internal.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedservices_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedservices_server.go index b9b9348abe0e..ec27758c9bb2 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedservices_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedservices_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -69,27 +66,46 @@ func (l *LinkedServicesServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LinkedServicesClient.BeginCreateOrUpdate": - resp, err = l.dispatchBeginCreateOrUpdate(req) - case "LinkedServicesClient.BeginDelete": - resp, err = l.dispatchBeginDelete(req) - case "LinkedServicesClient.Get": - resp, err = l.dispatchGet(req) - case "LinkedServicesClient.NewListByWorkspacePager": - resp, err = l.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LinkedServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if linkedServicesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = linkedServicesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LinkedServicesClient.BeginCreateOrUpdate": + res.resp, res.err = l.dispatchBeginCreateOrUpdate(req) + case "LinkedServicesClient.BeginDelete": + res.resp, res.err = l.dispatchBeginDelete(req) + case "LinkedServicesClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LinkedServicesClient.NewListByWorkspacePager": + res.resp, res.err = l.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LinkedServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -266,3 +282,9 @@ func (l *LinkedServicesServerTransport) dispatchNewListByWorkspacePager(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to LinkedServicesServerTransport +var linkedServicesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedstorageaccounts_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedstorageaccounts_server.go index 4e4474968f3b..605315e07ef1 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedstorageaccounts_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/linkedstorageaccounts_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -65,27 +62,46 @@ func (l *LinkedStorageAccountsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LinkedStorageAccountsClient.CreateOrUpdate": - resp, err = l.dispatchCreateOrUpdate(req) - case "LinkedStorageAccountsClient.Delete": - resp, err = l.dispatchDelete(req) - case "LinkedStorageAccountsClient.Get": - resp, err = l.dispatchGet(req) - case "LinkedStorageAccountsClient.NewListByWorkspacePager": - resp, err = l.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LinkedStorageAccountsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if linkedStorageAccountsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = linkedStorageAccountsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LinkedStorageAccountsClient.CreateOrUpdate": + res.resp, res.err = l.dispatchCreateOrUpdate(req) + case "LinkedStorageAccountsClient.Delete": + res.resp, res.err = l.dispatchDelete(req) + case "LinkedStorageAccountsClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LinkedStorageAccountsClient.NewListByWorkspacePager": + res.resp, res.err = l.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LinkedStorageAccountsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -258,3 +274,9 @@ func (l *LinkedStorageAccountsServerTransport) dispatchNewListByWorkspacePager(r } return resp, nil } + +// set this to conditionally intercept incoming requests to LinkedStorageAccountsServerTransport +var linkedStorageAccountsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/managementgroups_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/managementgroups_server.go index 5b03cd83cc0f..452116875e87 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/managementgroups_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/managementgroups_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -52,21 +49,40 @@ func (m *ManagementGroupsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagementGroupsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagementGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managementGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managementGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagementGroupsClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagementGroupsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (m *ManagementGroupsServerTransport) dispatchNewListPager(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagementGroupsServerTransport +var managementGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operations_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operations_server.go index 4a81c9b795a6..df38f9ee8621 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operations_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operationstatuses_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operationstatuses_server.go index c1ccd2c6cdab..4fee8b18a62d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operationstatuses_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/operationstatuses_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (o *OperationStatusesServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationStatusesClient.Get": - resp, err = o.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationStatusesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationStatusesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationStatusesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationStatusesClient.Get": + res.resp, res.err = o.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationStatusesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -98,3 +114,9 @@ func (o *OperationStatusesServerTransport) dispatchGet(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationStatusesServerTransport +var operationStatusesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/queries_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/queries_server.go index 6d71383b8742..72adc2353da2 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/queries_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/queries_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -77,31 +74,50 @@ func (q *QueriesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return q.dispatchToMethodFake(req, method) +} - switch method { - case "QueriesClient.Delete": - resp, err = q.dispatchDelete(req) - case "QueriesClient.Get": - resp, err = q.dispatchGet(req) - case "QueriesClient.NewListPager": - resp, err = q.dispatchNewListPager(req) - case "QueriesClient.Put": - resp, err = q.dispatchPut(req) - case "QueriesClient.NewSearchPager": - resp, err = q.dispatchNewSearchPager(req) - case "QueriesClient.Update": - resp, err = q.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (q *QueriesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if queriesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = queriesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QueriesClient.Delete": + res.resp, res.err = q.dispatchDelete(req) + case "QueriesClient.Get": + res.resp, res.err = q.dispatchGet(req) + case "QueriesClient.NewListPager": + res.resp, res.err = q.dispatchNewListPager(req) + case "QueriesClient.Put": + res.resp, res.err = q.dispatchPut(req) + case "QueriesClient.NewSearchPager": + res.resp, res.err = q.dispatchNewSearchPager(req) + case "QueriesClient.Update": + res.resp, res.err = q.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (q *QueriesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -417,3 +433,9 @@ func (q *QueriesServerTransport) dispatchUpdate(req *http.Request) (*http.Respon } return resp, nil } + +// set this to conditionally intercept incoming requests to QueriesServerTransport +var queriesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/querypacks_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/querypacks_server.go index 025629751d9f..2b8c7f293d69 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/querypacks_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/querypacks_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -80,33 +77,52 @@ func (q *QueryPacksServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return q.dispatchToMethodFake(req, method) +} - switch method { - case "QueryPacksClient.CreateOrUpdate": - resp, err = q.dispatchCreateOrUpdate(req) - case "QueryPacksClient.CreateOrUpdateWithoutName": - resp, err = q.dispatchCreateOrUpdateWithoutName(req) - case "QueryPacksClient.Delete": - resp, err = q.dispatchDelete(req) - case "QueryPacksClient.Get": - resp, err = q.dispatchGet(req) - case "QueryPacksClient.NewListPager": - resp, err = q.dispatchNewListPager(req) - case "QueryPacksClient.NewListByResourceGroupPager": - resp, err = q.dispatchNewListByResourceGroupPager(req) - case "QueryPacksClient.UpdateTags": - resp, err = q.dispatchUpdateTags(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (q *QueryPacksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if queryPacksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = queryPacksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QueryPacksClient.CreateOrUpdate": + res.resp, res.err = q.dispatchCreateOrUpdate(req) + case "QueryPacksClient.CreateOrUpdateWithoutName": + res.resp, res.err = q.dispatchCreateOrUpdateWithoutName(req) + case "QueryPacksClient.Delete": + res.resp, res.err = q.dispatchDelete(req) + case "QueryPacksClient.Get": + res.resp, res.err = q.dispatchGet(req) + case "QueryPacksClient.NewListPager": + res.resp, res.err = q.dispatchNewListPager(req) + case "QueryPacksClient.NewListByResourceGroupPager": + res.resp, res.err = q.dispatchNewListByResourceGroupPager(req) + case "QueryPacksClient.UpdateTags": + res.resp, res.err = q.dispatchUpdateTags(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (q *QueryPacksServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -351,3 +367,9 @@ func (q *QueryPacksServerTransport) dispatchUpdateTags(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to QueryPacksServerTransport +var queryPacksServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/savedsearches_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/savedsearches_server.go index c8213d338581..67707658decd 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/savedsearches_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/savedsearches_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -61,27 +58,46 @@ func (s *SavedSearchesServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "SavedSearchesClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SavedSearchesClient.Delete": - resp, err = s.dispatchDelete(req) - case "SavedSearchesClient.Get": - resp, err = s.dispatchGet(req) - case "SavedSearchesClient.ListByWorkspace": - resp, err = s.dispatchListByWorkspace(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (s *SavedSearchesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if savedSearchesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = savedSearchesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SavedSearchesClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SavedSearchesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SavedSearchesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SavedSearchesClient.ListByWorkspace": + res.resp, res.err = s.dispatchListByWorkspace(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (s *SavedSearchesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -231,3 +247,9 @@ func (s *SavedSearchesServerTransport) dispatchListByWorkspace(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to SavedSearchesServerTransport +var savedSearchesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/schema_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/schema_server.go index 9c913d4cdd32..856926e3e170 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/schema_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/schema_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (s *SchemaServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SchemaClient.Get": - resp, err = s.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SchemaServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if schemaServerTransportInterceptor != nil { + res.resp, res.err, intercepted = schemaServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SchemaClient.Get": + res.resp, res.err = s.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SchemaServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -98,3 +114,9 @@ func (s *SchemaServerTransport) dispatchGet(req *http.Request) (*http.Response, } return resp, nil } + +// set this to conditionally intercept incoming requests to SchemaServerTransport +var schemaServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/server_factory.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/server_factory.go index 92412d8a6cbe..8f6f9317126e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/server_factory.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -19,28 +16,71 @@ import ( // ServerFactory is a fake server for instances of the armoperationalinsights.ClientFactory type. type ServerFactory struct { + // AvailableServiceTiersServer contains the fakes for client AvailableServiceTiersClient AvailableServiceTiersServer AvailableServiceTiersServer - ClustersServer ClustersServer - DataExportsServer DataExportsServer - DataSourcesServer DataSourcesServer - DeletedWorkspacesServer DeletedWorkspacesServer - GatewaysServer GatewaysServer - IntelligencePacksServer IntelligencePacksServer - LinkedServicesServer LinkedServicesServer + + // ClustersServer contains the fakes for client ClustersClient + ClustersServer ClustersServer + + // DataExportsServer contains the fakes for client DataExportsClient + DataExportsServer DataExportsServer + + // DataSourcesServer contains the fakes for client DataSourcesClient + DataSourcesServer DataSourcesServer + + // DeletedWorkspacesServer contains the fakes for client DeletedWorkspacesClient + DeletedWorkspacesServer DeletedWorkspacesServer + + // GatewaysServer contains the fakes for client GatewaysClient + GatewaysServer GatewaysServer + + // IntelligencePacksServer contains the fakes for client IntelligencePacksClient + IntelligencePacksServer IntelligencePacksServer + + // LinkedServicesServer contains the fakes for client LinkedServicesClient + LinkedServicesServer LinkedServicesServer + + // LinkedStorageAccountsServer contains the fakes for client LinkedStorageAccountsClient LinkedStorageAccountsServer LinkedStorageAccountsServer - ManagementGroupsServer ManagementGroupsServer - OperationStatusesServer OperationStatusesServer - OperationsServer OperationsServer - QueriesServer QueriesServer - QueryPacksServer QueryPacksServer - SavedSearchesServer SavedSearchesServer - SchemaServer SchemaServer - SharedKeysServer SharedKeysServer + + // ManagementGroupsServer contains the fakes for client ManagementGroupsClient + ManagementGroupsServer ManagementGroupsServer + + // OperationStatusesServer contains the fakes for client OperationStatusesClient + OperationStatusesServer OperationStatusesServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // QueriesServer contains the fakes for client QueriesClient + QueriesServer QueriesServer + + // QueryPacksServer contains the fakes for client QueryPacksClient + QueryPacksServer QueryPacksServer + + // SavedSearchesServer contains the fakes for client SavedSearchesClient + SavedSearchesServer SavedSearchesServer + + // SchemaServer contains the fakes for client SchemaClient + SchemaServer SchemaServer + + // SharedKeysServer contains the fakes for client SharedKeysClient + SharedKeysServer SharedKeysServer + + // StorageInsightConfigsServer contains the fakes for client StorageInsightConfigsClient StorageInsightConfigsServer StorageInsightConfigsServer - TablesServer TablesServer - UsagesServer UsagesServer - WorkspacePurgeServer WorkspacePurgeServer - WorkspacesServer WorkspacesServer + + // TablesServer contains the fakes for client TablesClient + TablesServer TablesServer + + // UsagesServer contains the fakes for client UsagesClient + UsagesServer UsagesServer + + // WorkspacePurgeServer contains the fakes for client WorkspacePurgeClient + WorkspacePurgeServer WorkspacePurgeServer + + // WorkspacesServer contains the fakes for client WorkspacesClient + WorkspacesServer WorkspacesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/sharedkeys_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/sharedkeys_server.go index 329a89fc0b77..dda7b738b75e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/sharedkeys_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/sharedkeys_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (s *SharedKeysServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SharedKeysClient.GetSharedKeys": - resp, err = s.dispatchGetSharedKeys(req) - case "SharedKeysClient.Regenerate": - resp, err = s.dispatchRegenerate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SharedKeysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sharedKeysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sharedKeysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SharedKeysClient.GetSharedKeys": + res.resp, res.err = s.dispatchGetSharedKeys(req) + case "SharedKeysClient.Regenerate": + res.resp, res.err = s.dispatchRegenerate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SharedKeysServerTransport) dispatchGetSharedKeys(req *http.Request) (*http.Response, error) { @@ -137,3 +153,9 @@ func (s *SharedKeysServerTransport) dispatchRegenerate(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to SharedKeysServerTransport +var sharedKeysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/storageinsightconfigs_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/storageinsightconfigs_server.go index 693b7f0ca573..db1c580e550d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/storageinsightconfigs_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/storageinsightconfigs_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (s *StorageInsightConfigsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "StorageInsightConfigsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "StorageInsightConfigsClient.Delete": - resp, err = s.dispatchDelete(req) - case "StorageInsightConfigsClient.Get": - resp, err = s.dispatchGet(req) - case "StorageInsightConfigsClient.NewListByWorkspacePager": - resp, err = s.dispatchNewListByWorkspacePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *StorageInsightConfigsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if storageInsightConfigsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = storageInsightConfigsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StorageInsightConfigsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "StorageInsightConfigsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "StorageInsightConfigsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "StorageInsightConfigsClient.NewListByWorkspacePager": + res.resp, res.err = s.dispatchNewListByWorkspacePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *StorageInsightConfigsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -244,3 +260,9 @@ func (s *StorageInsightConfigsServerTransport) dispatchNewListByWorkspacePager(r } return resp, nil } + +// set this to conditionally intercept incoming requests to StorageInsightConfigsServerTransport +var storageInsightConfigsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/tables_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/tables_server.go index 8440f5ca82f8..e8957df035b9 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/tables_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/tables_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -23,6 +20,10 @@ import ( // TablesServer is a fake server for instances of the armoperationalinsights.TablesClient type. type TablesServer struct { + // CancelSearch is the fake for method TablesClient.CancelSearch + // HTTP status codes to indicate success: http.StatusOK + CancelSearch func(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *armoperationalinsights.TablesClientCancelSearchOptions) (resp azfake.Responder[armoperationalinsights.TablesClientCancelSearchResponse], errResp azfake.ErrorResponder) + // BeginCreateOrUpdate is the fake for method TablesClient.BeginCreateOrUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters armoperationalinsights.Table, options *armoperationalinsights.TablesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armoperationalinsights.TablesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) @@ -79,30 +80,88 @@ func (t *TablesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return t.dispatchToMethodFake(req, method) +} + +func (t *TablesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if tablesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tablesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TablesClient.CancelSearch": + res.resp, res.err = t.dispatchCancelSearch(req) + case "TablesClient.BeginCreateOrUpdate": + res.resp, res.err = t.dispatchBeginCreateOrUpdate(req) + case "TablesClient.BeginDelete": + res.resp, res.err = t.dispatchBeginDelete(req) + case "TablesClient.Get": + res.resp, res.err = t.dispatchGet(req) + case "TablesClient.NewListByWorkspacePager": + res.resp, res.err = t.dispatchNewListByWorkspacePager(req) + case "TablesClient.Migrate": + res.resp, res.err = t.dispatchMigrate(req) + case "TablesClient.BeginUpdate": + res.resp, res.err = t.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - switch method { - case "TablesClient.BeginCreateOrUpdate": - resp, err = t.dispatchBeginCreateOrUpdate(req) - case "TablesClient.BeginDelete": - resp, err = t.dispatchBeginDelete(req) - case "TablesClient.Get": - resp, err = t.dispatchGet(req) - case "TablesClient.NewListByWorkspacePager": - resp, err = t.dispatchNewListByWorkspacePager(req) - case "TablesClient.Migrate": - resp, err = t.dispatchMigrate(req) - case "TablesClient.BeginUpdate": - resp, err = t.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } +} +func (t *TablesServerTransport) dispatchCancelSearch(req *http.Request) (*http.Response, error) { + if t.srv.CancelSearch == nil { + return nil, &nonRetriableError{errors.New("fake for method CancelSearch not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancelSearch` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + tableNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("tableName")]) + if err != nil { + return nil, err + } + respr, errRespr := t.srv.CancelSearch(req.Context(), resourceGroupNameParam, workspaceNameParam, tableNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) if err != nil { return nil, err } - return resp, nil } @@ -112,7 +171,7 @@ func (t *TablesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) ( } beginCreateOrUpdate := t.beginCreateOrUpdate.get(req) if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 4 { @@ -164,7 +223,7 @@ func (t *TablesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re } beginDelete := t.beginDelete.get(req) if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 4 { @@ -210,7 +269,7 @@ func (t *TablesServerTransport) dispatchGet(req *http.Request) (*http.Response, if t.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 4 { @@ -249,7 +308,7 @@ func (t *TablesServerTransport) dispatchNewListByWorkspacePager(req *http.Reques } newListByWorkspacePager := t.newListByWorkspacePager.get(req) if newListByWorkspacePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 3 { @@ -285,7 +344,7 @@ func (t *TablesServerTransport) dispatchMigrate(req *http.Request) (*http.Respon if t.srv.Migrate == nil { return nil, &nonRetriableError{errors.New("fake for method Migrate not implemented")} } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrate` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrate` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 4 { @@ -324,7 +383,7 @@ func (t *TablesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re } beginUpdate := t.beginUpdate.get(req) if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourcegroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/tables/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) if matches == nil || len(matches) < 4 { @@ -369,3 +428,9 @@ func (t *TablesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re return resp, nil } + +// set this to conditionally intercept incoming requests to TablesServerTransport +var tablesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/time_rfc3339.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/time_rfc3339.go index 81f308b0d343..7691a451714b 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/time_rfc3339.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/usages_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/usages_server.go index 10d7b17870e4..012b74fc8396 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/usages_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/usages_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -52,21 +49,40 @@ func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return u.dispatchToMethodFake(req, method) +} - switch method { - case "UsagesClient.NewListPager": - resp, err = u.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if usagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = usagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "UsagesClient.NewListPager": + res.resp, res.err = u.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -106,3 +122,9 @@ func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to UsagesServerTransport +var usagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspacepurge_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspacepurge_server.go index 39477b1656be..27f6f1d7e24f 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspacepurge_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspacepurge_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (w *WorkspacePurgeServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WorkspacePurgeClient.GetPurgeStatus": - resp, err = w.dispatchGetPurgeStatus(req) - case "WorkspacePurgeClient.Purge": - resp, err = w.dispatchPurge(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WorkspacePurgeServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if workspacePurgeServerTransportInterceptor != nil { + res.resp, res.err, intercepted = workspacePurgeServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WorkspacePurgeClient.GetPurgeStatus": + res.resp, res.err = w.dispatchGetPurgeStatus(req) + case "WorkspacePurgeClient.Purge": + res.resp, res.err = w.dispatchPurge(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WorkspacePurgeServerTransport) dispatchGetPurgeStatus(req *http.Request) (*http.Response, error) { @@ -148,3 +164,9 @@ func (w *WorkspacePurgeServerTransport) dispatchPurge(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to WorkspacePurgeServerTransport +var workspacePurgeServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspaces_server.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspaces_server.go index c746bc503907..fbc29733c9cd 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspaces_server.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/fake/workspaces_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -15,6 +12,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" "net/http" "net/url" @@ -36,6 +34,10 @@ type WorkspacesServer struct { // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, workspaceName string, options *armoperationalinsights.WorkspacesClientGetOptions) (resp azfake.Responder[armoperationalinsights.WorkspacesClientGetResponse], errResp azfake.ErrorResponder) + // GetNSP is the fake for method WorkspacesClient.GetNSP + // HTTP status codes to indicate success: http.StatusOK + GetNSP func(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, options *armoperationalinsights.WorkspacesClientGetNSPOptions) (resp azfake.Responder[armoperationalinsights.WorkspacesClientGetNSPResponse], errResp azfake.ErrorResponder) + // NewListPager is the fake for method WorkspacesClient.NewListPager // HTTP status codes to indicate success: http.StatusOK NewListPager func(options *armoperationalinsights.WorkspacesClientListOptions) (resp azfake.PagerResponder[armoperationalinsights.WorkspacesClientListResponse]) @@ -44,6 +46,14 @@ type WorkspacesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListByResourceGroupPager func(resourceGroupName string, options *armoperationalinsights.WorkspacesClientListByResourceGroupOptions) (resp azfake.PagerResponder[armoperationalinsights.WorkspacesClientListByResourceGroupResponse]) + // NewListNSPPager is the fake for method WorkspacesClient.NewListNSPPager + // HTTP status codes to indicate success: http.StatusOK + NewListNSPPager func(resourceGroupName string, workspaceName string, options *armoperationalinsights.WorkspacesClientListNSPOptions) (resp azfake.PagerResponder[armoperationalinsights.WorkspacesClientListNSPResponse]) + + // BeginReconcileNSP is the fake for method WorkspacesClient.BeginReconcileNSP + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginReconcileNSP func(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, options *armoperationalinsights.WorkspacesClientBeginReconcileNSPOptions) (resp azfake.PollerResponder[armoperationalinsights.WorkspacesClientReconcileNSPResponse], errResp azfake.ErrorResponder) + // Update is the fake for method WorkspacesClient.Update // HTTP status codes to indicate success: http.StatusOK Update func(ctx context.Context, resourceGroupName string, workspaceName string, parameters armoperationalinsights.WorkspacePatch, options *armoperationalinsights.WorkspacesClientUpdateOptions) (resp azfake.Responder[armoperationalinsights.WorkspacesClientUpdateResponse], errResp azfake.ErrorResponder) @@ -59,6 +69,8 @@ func NewWorkspacesServerTransport(srv *WorkspacesServer) *WorkspacesServerTransp beginDelete: newTracker[azfake.PollerResponder[armoperationalinsights.WorkspacesClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListByResourceGroupResponse]](), + newListNSPPager: newTracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListNSPResponse]](), + beginReconcileNSP: newTracker[azfake.PollerResponder[armoperationalinsights.WorkspacesClientReconcileNSPResponse]](), } } @@ -70,6 +82,8 @@ type WorkspacesServerTransport struct { beginDelete *tracker[azfake.PollerResponder[armoperationalinsights.WorkspacesClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListByResourceGroupResponse]] + newListNSPPager *tracker[azfake.PagerResponder[armoperationalinsights.WorkspacesClientListNSPResponse]] + beginReconcileNSP *tracker[azfake.PollerResponder[armoperationalinsights.WorkspacesClientReconcileNSPResponse]] } // Do implements the policy.Transporter interface for WorkspacesServerTransport. @@ -80,31 +94,56 @@ func (w *WorkspacesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WorkspacesClient.BeginCreateOrUpdate": - resp, err = w.dispatchBeginCreateOrUpdate(req) - case "WorkspacesClient.BeginDelete": - resp, err = w.dispatchBeginDelete(req) - case "WorkspacesClient.Get": - resp, err = w.dispatchGet(req) - case "WorkspacesClient.NewListPager": - resp, err = w.dispatchNewListPager(req) - case "WorkspacesClient.NewListByResourceGroupPager": - resp, err = w.dispatchNewListByResourceGroupPager(req) - case "WorkspacesClient.Update": - resp, err = w.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WorkspacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if workspacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = workspacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WorkspacesClient.BeginCreateOrUpdate": + res.resp, res.err = w.dispatchBeginCreateOrUpdate(req) + case "WorkspacesClient.BeginDelete": + res.resp, res.err = w.dispatchBeginDelete(req) + case "WorkspacesClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WorkspacesClient.GetNSP": + res.resp, res.err = w.dispatchGetNSP(req) + case "WorkspacesClient.NewListPager": + res.resp, res.err = w.dispatchNewListPager(req) + case "WorkspacesClient.NewListByResourceGroupPager": + res.resp, res.err = w.dispatchNewListByResourceGroupPager(req) + case "WorkspacesClient.NewListNSPPager": + res.resp, res.err = w.dispatchNewListNSPPager(req) + case "WorkspacesClient.BeginReconcileNSP": + res.resp, res.err = w.dispatchBeginReconcileNSP(req) + case "WorkspacesClient.Update": + res.resp, res.err = w.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WorkspacesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -247,6 +286,43 @@ func (w *WorkspacesServerTransport) dispatchGet(req *http.Request) (*http.Respon return resp, nil } +func (w *WorkspacesServerTransport) dispatchGetNSP(req *http.Request) (*http.Response, error) { + if w.srv.GetNSP == nil { + return nil, &nonRetriableError{errors.New("fake for method GetNSP not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.GetNSP(req.Context(), resourceGroupNameParam, workspaceNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (w *WorkspacesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { if w.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} @@ -311,6 +387,95 @@ func (w *WorkspacesServerTransport) dispatchNewListByResourceGroupPager(req *htt return resp, nil } +func (w *WorkspacesServerTransport) dispatchNewListNSPPager(req *http.Request) (*http.Response, error) { + if w.srv.NewListNSPPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListNSPPager not implemented")} + } + newListNSPPager := w.newListNSPPager.get(req) + if newListNSPPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + resp := w.srv.NewListNSPPager(resourceGroupNameParam, workspaceNameParam, nil) + newListNSPPager = &resp + w.newListNSPPager.add(req, newListNSPPager) + server.PagerResponderInjectNextLinks(newListNSPPager, req, func(page *armoperationalinsights.WorkspacesClientListNSPResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListNSPPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + w.newListNSPPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListNSPPager) { + w.newListNSPPager.remove(req) + } + return resp, nil +} + +func (w *WorkspacesServerTransport) dispatchBeginReconcileNSP(req *http.Request) (*http.Response, error) { + if w.srv.BeginReconcileNSP == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReconcileNSP not implemented")} + } + beginReconcileNSP := w.beginReconcileNSP.get(req) + if beginReconcileNSP == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.OperationalInsights/workspaces/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + workspaceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workspaceName")]) + if err != nil { + return nil, err + } + networkSecurityPerimeterConfigurationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("networkSecurityPerimeterConfigurationName")]) + if err != nil { + return nil, err + } + respr, errRespr := w.srv.BeginReconcileNSP(req.Context(), resourceGroupNameParam, workspaceNameParam, networkSecurityPerimeterConfigurationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReconcileNSP = &respr + w.beginReconcileNSP.add(req, beginReconcileNSP) + } + + resp, err := server.PollerResponderNext(beginReconcileNSP, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + w.beginReconcileNSP.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginReconcileNSP) { + w.beginReconcileNSP.remove(req) + } + + return resp, nil +} + func (w *WorkspacesServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { if w.srv.Update == nil { return nil, &nonRetriableError{errors.New("fake for method Update not implemented")} @@ -347,3 +512,9 @@ func (w *WorkspacesServerTransport) dispatchUpdate(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to WorkspacesServerTransport +var workspacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go index c1e229569a56..0d27d1de13c0 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGatewaysClient(subscriptionID string, credential azcore.TokenCredential, // Delete - Delete a Log Analytics gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - gatewayID - The Log Analytics gateway Id. @@ -73,7 +70,7 @@ func (client *GatewaysClient) Delete(ctx context.Context, resourceGroupName stri } // deleteCreateRequest creates the Delete request. -func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string, options *GatewaysClientDeleteOptions) (*policy.Request, error) { +func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string, _ *GatewaysClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -96,7 +93,7 @@ func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client_example_test.go deleted file mode 100644 index 820d7832a8bd..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/gateways_client_example_test.go +++ /dev/null @@ -1,35 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGatewaysDelete.json -func ExampleGatewaysClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGatewaysClient().Delete(ctx, "OIAutoRest5123", "aztest5048", "00000000-0000-0000-0000-00000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod index cf250ee81787..f9a8a3a487ea 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go index dd5e5a1bd85f..efde3a3037a3 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewIntelligencePacksClient(subscriptionID string, credential azcore.TokenCr // Disable - Disables an intelligence pack for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - intelligencePackName - The name of the intelligence pack to be disabled. @@ -74,7 +71,7 @@ func (client *IntelligencePacksClient) Disable(ctx context.Context, resourceGrou } // disableCreateRequest creates the Disable request. -func (client *IntelligencePacksClient) disableCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string, options *IntelligencePacksClientDisableOptions) (*policy.Request, error) { +func (client *IntelligencePacksClient) disableCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string, _ *IntelligencePacksClientDisableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -97,7 +94,7 @@ func (client *IntelligencePacksClient) disableCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -105,7 +102,7 @@ func (client *IntelligencePacksClient) disableCreateRequest(ctx context.Context, // Enable - Enables an intelligence pack for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - intelligencePackName - The name of the intelligence pack to be enabled. @@ -133,7 +130,7 @@ func (client *IntelligencePacksClient) Enable(ctx context.Context, resourceGroup } // enableCreateRequest creates the Enable request. -func (client *IntelligencePacksClient) enableCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string, options *IntelligencePacksClientEnableOptions) (*policy.Request, error) { +func (client *IntelligencePacksClient) enableCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string, _ *IntelligencePacksClientEnableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -156,7 +153,7 @@ func (client *IntelligencePacksClient) enableCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -164,7 +161,7 @@ func (client *IntelligencePacksClient) enableCreateRequest(ctx context.Context, // List - Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - IntelligencePacksClientListOptions contains the optional parameters for the IntelligencePacksClient.List method. @@ -191,7 +188,7 @@ func (client *IntelligencePacksClient) List(ctx context.Context, resourceGroupNa } // listCreateRequest creates the List request. -func (client *IntelligencePacksClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *IntelligencePacksClientListOptions) (*policy.Request, error) { +func (client *IntelligencePacksClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *IntelligencePacksClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -210,7 +207,7 @@ func (client *IntelligencePacksClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client_example_test.go deleted file mode 100644 index 9cea686cb450..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/intelligencepacks_client_example_test.go +++ /dev/null @@ -1,303 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDisableIntelligencePack.json -func ExampleIntelligencePacksClient_Disable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIntelligencePacksClient().Disable(ctx, "rg1", "TestLinkWS", "ChangeTracking", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesEnableIntelligencePack.json -func ExampleIntelligencePacksClient_Enable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIntelligencePacksClient().Enable(ctx, "rg1", "TestLinkWS", "ChangeTracking", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListIntelligencePacks.json -func ExampleIntelligencePacksClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIntelligencePacksClient().List(ctx, "rg1", "TestLinkWS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IntelligencePackArray = []*armoperationalinsights.IntelligencePack{ - // { - // Name: to.Ptr("CapacityPerformance"), - // DisplayName: to.Ptr("Capacity and Performance"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureWebAppsAnalytics"), - // DisplayName: to.Ptr("Azure Web Apps Analytics (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Security"), - // DisplayName: to.Ptr("Security and Audit"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Updates"), - // DisplayName: to.Ptr("Update Management"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AntiMalware"), - // DisplayName: to.Ptr("Antimalware Assessment"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("LogManagement"), - // DisplayName: to.Ptr("Log Management"), - // Enabled: to.Ptr(true), - // }, - // { - // Name: to.Ptr("ChangeTracking"), - // DisplayName: to.Ptr("Change Tracking"), - // Enabled: to.Ptr(true), - // }, - // { - // Name: to.Ptr("SQLAssessment"), - // DisplayName: to.Ptr("SQL Assessment"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SCOMAssessment"), - // DisplayName: to.Ptr("System Center Operations Manager Assessment (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ServiceDesk"), - // DisplayName: to.Ptr("IT Service Management Connector(Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ADAssessment"), - // DisplayName: to.Ptr("AD Assessment"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AlertManagement"), - // DisplayName: to.Ptr("Alert Management"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureAutomation"), - // DisplayName: to.Ptr("Azure Automation"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("WireData"), - // DisplayName: to.Ptr("Wire Data"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SiteRecovery"), - // DisplayName: to.Ptr("Azure Site Recovery"), - // Enabled: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Backup"), - // DisplayName: to.Ptr("Backup"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SurfaceHub"), - // DisplayName: to.Ptr("Surface Hub"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("NetworkMonitoring"), - // DisplayName: to.Ptr("Network Performance Monitor"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Containers"), - // DisplayName: to.Ptr("Container Monitoring Solution"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ServiceMap"), - // DisplayName: to.Ptr("Service Map"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureNetworking"), - // DisplayName: to.Ptr("Azure Networking Analytics (Deprecated)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ADReplication"), - // DisplayName: to.Ptr("AD Replication Status"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Office365"), - // DisplayName: to.Ptr("Office 365 (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("CompatibilityAssessment"), - // DisplayName: to.Ptr("Upgrade Readiness"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("KeyVault"), - // DisplayName: to.Ptr("Key Vault (Deprecated)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ServiceFabric"), - // DisplayName: to.Ptr("Service Fabric"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DnsAnalytics"), - // DisplayName: to.Ptr("DNS Analytics (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ApplicationInsights"), - // DisplayName: to.Ptr("Application Insights (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("WireData2"), - // DisplayName: to.Ptr("Wire Data 2.0"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("WaaSUpdateInsights"), - // DisplayName: to.Ptr("Update Compliance (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AgentHealthAssessment"), - // DisplayName: to.Ptr("Agent Health "), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureActivity"), - // DisplayName: to.Ptr("Activity Log Analytics"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HDInsight"), - // DisplayName: to.Ptr("HDInsight HBase Monitoring (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HDInsightKafka"), - // DisplayName: to.Ptr("HDInsight Kafka Monitoring"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("HDInsightSpark"), - // DisplayName: to.Ptr("HDInsight Spark Monitoring"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("VMware"), - // DisplayName: to.Ptr("VMware (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SecurityCenterFree"), - // DisplayName: to.Ptr("Security Center Free � for Azure Resources only"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("LogicAppsManagement"), - // DisplayName: to.Ptr("Logic Apps Management"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("LogicAppB2B"), - // DisplayName: to.Ptr("Logic Apps B2B"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureSQLAnalytics"), - // DisplayName: to.Ptr("Azure SQL Analytics (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("KeyVaultAnalytics"), - // DisplayName: to.Ptr("Key Vault Analytics"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureNSGAnalytics"), - // DisplayName: to.Ptr("Azure Network Security Group Analytics"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AzureAppGatewayAnalytics"), - // DisplayName: to.Ptr("Azure Application Gateway Analytics"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DeviceHealthProd"), - // DisplayName: to.Ptr("Device Health (Preview)"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("WindowsDefenderATP"), - // DisplayName: to.Ptr("Windows Defender ATP"), - // Enabled: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ProcessInvestigator"), - // DisplayName: to.Ptr("ProcessInvestigator"), - // Enabled: to.Ptr(false), - // }} -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go index a4f80f760763..e10db330e5cb 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewLinkedServicesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Create or update a linked service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - linkedServiceName - Name of the linkedServices resource @@ -73,7 +70,7 @@ func (client *LinkedServicesClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Create or update a linked service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 func (client *LinkedServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService, options *LinkedServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "LinkedServicesClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *LinkedServicesClient) createOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LinkedServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService, options *LinkedServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *LinkedServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService, _ *LinkedServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -119,7 +116,7 @@ func (client *LinkedServicesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +128,7 @@ func (client *LinkedServicesClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a linked service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - linkedServiceName - Name of the linked service. @@ -157,7 +154,7 @@ func (client *LinkedServicesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a linked service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 func (client *LinkedServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, options *LinkedServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "LinkedServicesClient.BeginDelete" @@ -180,7 +177,7 @@ func (client *LinkedServicesClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *LinkedServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, options *LinkedServicesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *LinkedServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, _ *LinkedServicesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -203,7 +200,7 @@ func (client *LinkedServicesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +209,7 @@ func (client *LinkedServicesClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a linked service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - linkedServiceName - Name of the linked service. @@ -240,7 +237,7 @@ func (client *LinkedServicesClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *LinkedServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, options *LinkedServicesClientGetOptions) (*policy.Request, error) { +func (client *LinkedServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, _ *LinkedServicesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -263,7 +260,7 @@ func (client *LinkedServicesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +277,7 @@ func (client *LinkedServicesClient) getHandleResponse(resp *http.Response) (Link // NewListByWorkspacePager - Gets the linked services instances in a workspace. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - LinkedServicesClientListByWorkspaceOptions contains the optional parameters for the LinkedServicesClient.NewListByWorkspacePager @@ -310,7 +307,7 @@ func (client *LinkedServicesClient) NewListByWorkspacePager(resourceGroupName st } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *LinkedServicesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *LinkedServicesClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *LinkedServicesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *LinkedServicesClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +326,7 @@ func (client *LinkedServicesClient) listByWorkspaceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client_example_test.go deleted file mode 100644 index ad9496cdba6f..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedservices_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesCreate.json -func ExampleLinkedServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkedServicesClient().BeginCreateOrUpdate(ctx, "mms-eus", "TestLinkWS", "Cluster", armoperationalinsights.LinkedService{ - Properties: &armoperationalinsights.LinkedServiceProperties{ - WriteAccessResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster"), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedService = armoperationalinsights.LinkedService{ - // Name: to.Ptr("TestLinkWS/Cluster"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster"), - // Properties: &armoperationalinsights.LinkedServiceProperties{ - // ProvisioningState: to.Ptr(armoperationalinsights.LinkedServiceEntityStatusSucceeded), - // WriteAccessResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesDelete.json -func ExampleLinkedServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLinkedServicesClient().BeginDelete(ctx, "rg1", "TestLinkWS", "Cluster", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedService = armoperationalinsights.LinkedService{ - // Name: to.Ptr("TestLinkWS/Cluster"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster"), - // Properties: &armoperationalinsights.LinkedServiceProperties{ - // ProvisioningState: to.Ptr(armoperationalinsights.LinkedServiceEntityStatusSucceeded), - // WriteAccessResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesGet.json -func ExampleLinkedServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkedServicesClient().Get(ctx, "mms-eus", "TestLinkWS", "Cluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedService = armoperationalinsights.LinkedService{ - // Name: to.Ptr("TestLinkWS/Cluster"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster"), - // Properties: &armoperationalinsights.LinkedServiceProperties{ - // ProvisioningState: to.Ptr(armoperationalinsights.LinkedServiceEntityStatusSucceeded), - // WriteAccessResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/testcluster"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesListByWorkspace.json -func ExampleLinkedServicesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkedServicesClient().NewListByWorkspacePager("mms-eus", "TestLinkWS", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkedServiceListResult = armoperationalinsights.LinkedServiceListResult{ - // Value: []*armoperationalinsights.LinkedService{ - // { - // Name: to.Ptr("TestLinkWS/Automation"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/automation"), - // Properties: &armoperationalinsights.LinkedServiceProperties{ - // ProvisioningState: to.Ptr(armoperationalinsights.LinkedServiceEntityStatusSucceeded), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.Automation/automationAccounts/TestAccount"), - // }, - // }, - // { - // Name: to.Ptr("TestLinkWS/Cluster"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testlinkws/linkedservices/cluster"), - // Properties: &armoperationalinsights.LinkedServiceProperties{ - // ProvisioningState: to.Ptr(armoperationalinsights.LinkedServiceEntityStatusSucceeded), - // WriteAccessResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/clusters/TestCluster"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go index 409a53ece702..38391246a403 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewLinkedStorageAccountsClient(subscriptionID string, credential azcore.Tok // data source type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceType - Linked storage accounts type. @@ -77,7 +74,7 @@ func (client *LinkedStorageAccountsClient) CreateOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LinkedStorageAccountsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, parameters LinkedStorageAccountsResource, options *LinkedStorageAccountsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *LinkedStorageAccountsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, parameters LinkedStorageAccountsResource, _ *LinkedStorageAccountsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *LinkedStorageAccountsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -121,7 +118,7 @@ func (client *LinkedStorageAccountsClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes all linked storage accounts of a specific data source type associated with the specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceType - Linked storage accounts type. @@ -149,7 +146,7 @@ func (client *LinkedStorageAccountsClient) Delete(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *LinkedStorageAccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, options *LinkedStorageAccountsClientDeleteOptions) (*policy.Request, error) { +func (client *LinkedStorageAccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, _ *LinkedStorageAccountsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -172,7 +169,7 @@ func (client *LinkedStorageAccountsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -180,7 +177,7 @@ func (client *LinkedStorageAccountsClient) deleteCreateRequest(ctx context.Conte // Get - Gets all linked storage account of a specific data source type associated with the specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - dataSourceType - Linked storage accounts type. @@ -209,7 +206,7 @@ func (client *LinkedStorageAccountsClient) Get(ctx context.Context, resourceGrou } // getCreateRequest creates the Get request. -func (client *LinkedStorageAccountsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, options *LinkedStorageAccountsClientGetOptions) (*policy.Request, error) { +func (client *LinkedStorageAccountsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, _ *LinkedStorageAccountsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -232,7 +229,7 @@ func (client *LinkedStorageAccountsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +247,7 @@ func (client *LinkedStorageAccountsClient) getHandleResponse(resp *http.Response // NewListByWorkspacePager - Gets all linked storage accounts associated with the specified workspace, storage accounts will // be sorted by their data source type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - LinkedStorageAccountsClientListByWorkspaceOptions contains the optional parameters for the LinkedStorageAccountsClient.NewListByWorkspacePager @@ -280,7 +277,7 @@ func (client *LinkedStorageAccountsClient) NewListByWorkspacePager(resourceGroup } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *LinkedStorageAccountsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *LinkedStorageAccountsClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *LinkedStorageAccountsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *LinkedStorageAccountsClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -299,7 +296,7 @@ func (client *LinkedStorageAccountsClient) listByWorkspaceCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client_example_test.go deleted file mode 100644 index a5ac3681a17b..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/linkedstorageaccounts_client_example_test.go +++ /dev/null @@ -1,176 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsCreate.json -func ExampleLinkedStorageAccountsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkedStorageAccountsClient().CreateOrUpdate(ctx, "mms-eus", "testLinkStorageAccountsWS", armoperationalinsights.DataSourceTypeCustomLogs, armoperationalinsights.LinkedStorageAccountsResource{ - Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - StorageAccountIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedStorageAccountsResource = armoperationalinsights.LinkedStorageAccountsResource{ - // Name: to.Ptr("CustomLogs"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/CustomLogs"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeCustomLogs), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsDelete.json -func ExampleLinkedStorageAccountsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewLinkedStorageAccountsClient().Delete(ctx, "mms-eus", "testLinkStorageAccountsWS", armoperationalinsights.DataSourceTypeCustomLogs, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsGet.json -func ExampleLinkedStorageAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLinkedStorageAccountsClient().Get(ctx, "mms-eus", "testLinkStorageAccountsWS", armoperationalinsights.DataSourceTypeCustomLogs, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LinkedStorageAccountsResource = armoperationalinsights.LinkedStorageAccountsResource{ - // Name: to.Ptr("CustomLogs"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/CustomLogs"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeCustomLogs), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsListByWorkspace.json -func ExampleLinkedStorageAccountsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLinkedStorageAccountsClient().NewListByWorkspacePager("mms-eus", "testLinkStorageAccountsWS", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkedStorageAccountsListResult = armoperationalinsights.LinkedStorageAccountsListResult{ - // Value: []*armoperationalinsights.LinkedStorageAccountsResource{ - // { - // Name: to.Ptr("CustomLogs"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/CustomLogs"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeCustomLogs), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageB")}, - // }, - // }, - // { - // Name: to.Ptr("AzureWatson"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/AzureWatson"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeAzureWatson), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageC")}, - // }, - // }, - // { - // Name: to.Ptr("Query"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/Query"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeQuery), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageC")}, - // }, - // }, - // { - // Name: to.Ptr("Alerts"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/testLinkStorageAccountsWS/linkedStorageAccounts/Alerts"), - // Properties: &armoperationalinsights.LinkedStorageAccountsProperties{ - // DataSourceType: to.Ptr(armoperationalinsights.DataSourceTypeAlerts), - // StorageAccountIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageA"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/mms-eus/providers/Microsoft.Storage/storageAccounts/testStorageC")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go index 9bac9d369e99..d96ea289a762 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewManagementGroupsClient(subscriptionID string, credential azcore.TokenCre // NewListPager - Gets a list of management groups connected to a workspace. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - ManagementGroupsClientListOptions contains the optional parameters for the ManagementGroupsClient.NewListPager @@ -75,7 +72,7 @@ func (client *ManagementGroupsClient) NewListPager(resourceGroupName string, wor } // listCreateRequest creates the List request. -func (client *ManagementGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ManagementGroupsClientListOptions) (*policy.Request, error) { +func (client *ManagementGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *ManagementGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *ManagementGroupsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client_example_test.go deleted file mode 100644 index d6389a95f654..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/managementgroups_client_example_test.go +++ /dev/null @@ -1,47 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json -func ExampleManagementGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagementGroupsClient().NewListPager("rg1", "TestLinkWS", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListManagementGroupsResult = armoperationalinsights.WorkspaceListManagementGroupsResult{ - // Value: []*armoperationalinsights.ManagementGroup{ - // }, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go index 55404d79a51b..ad5d9e6ca316 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -10,18 +7,57 @@ package armoperationalinsights import "time" +// AccessRule - Access rule in a network security perimeter configuration profile +type AccessRule struct { + // Name of the access rule + Name *string + + // Properties of Access Rule + Properties *AccessRuleProperties +} + +// AccessRuleProperties - Properties of Access Rule +type AccessRuleProperties struct { + // Address prefixes in the CIDR format for inbound rules + AddressPrefixes []*string + + // Direction of Access Rule + Direction *AccessRuleDirection + + // Email addresses for outbound rules + EmailAddresses []*string + + // Fully qualified domain names (FQDN) for outbound rules + FullyQualifiedDomainNames []*string + + // Network security perimeters for inbound rules + NetworkSecurityPerimeters []*NetworkSecurityPerimeter + + // Phone numbers for outbound rules + PhoneNumbers []*string + + // Subscriptions for inbound rules + Subscriptions []*AccessRulePropertiesSubscriptionsItem +} + +// AccessRulePropertiesSubscriptionsItem - Subscription identifiers +type AccessRulePropertiesSubscriptionsItem struct { + // The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') + ID *string +} + // AssociatedWorkspace - The list of Log Analytics workspaces associated with the cluster. type AssociatedWorkspace struct { // READ-ONLY; The time of workspace association. - AssociateDate *string + AssociateDate *time.Time - // READ-ONLY; The ResourceId id the assigned workspace. + // READ-ONLY; Associated workspace arm resource id, in the form of: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}. ResourceID *string - // READ-ONLY; The id of the assigned workspace. + // READ-ONLY; Associated workspace immutable id. WorkspaceID *string - // READ-ONLY; The name id the assigned workspace. + // READ-ONLY; Associated workspace resource name. WorkspaceName *string } @@ -64,27 +100,12 @@ type AzureEntityResource struct { Type *string } -// AzureResourceProperties - An Azure resource QueryPack-Query object -type AzureResourceProperties struct { - // READ-ONLY; Azure resource Id - ID *string - - // READ-ONLY; Azure resource name - Name *string - - // READ-ONLY; Read only system data - SystemData *SystemData - - // READ-ONLY; Azure resource type - Type *string -} - // CapacityReservationProperties - The Capacity Reservation properties. type CapacityReservationProperties struct { // READ-ONLY; The last time Sku was updated. - LastSKUUpdate *string + LastSKUUpdate *time.Time - // READ-ONLY; Minimum CapacityReservation value in GB. + // READ-ONLY; Minimum CapacityReservation value in Gigabytes. MinCapacity *int64 } @@ -93,8 +114,8 @@ type Cluster struct { // REQUIRED; The geo-location where the resource lives Location *string - // The identity of the resource. - Identity *Identity + // Resource's identity. + Identity *ManagedServiceIdentity // Log Analytics cluster properties. Properties *ClusterProperties @@ -126,8 +147,8 @@ type ClusterListResult struct { // ClusterPatch - The top level Log Analytics cluster resource container. type ClusterPatch struct { - // The identity of the resource. - Identity *Identity + // Resource's identity. + Identity *ManagedServiceIdentity // Log Analytics cluster properties. Properties *ClusterPatchProperties @@ -171,25 +192,49 @@ type ClusterProperties struct { // The associated key properties. KeyVaultProperties *KeyVaultProperties + // Cluster's replication properties. + Replication *ClusterReplicationProperties + // READ-ONLY; The ID associated with the cluster. ClusterID *string // READ-ONLY; The cluster creation time - CreatedDate *string + CreatedDate *time.Time // READ-ONLY; The last time the cluster was updated. - LastModifiedDate *string + LastModifiedDate *time.Time // READ-ONLY; The provisioning state of the cluster. ProvisioningState *ClusterEntityStatus } +// ClusterReplicationProperties - Cluster replication properties. +type ClusterReplicationProperties struct { + // Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified location. + Enabled *bool + + // Should enable AvailabilityZones for the given replicated cluster + IsAvailabilityZonesEnabled *bool + + // The secondary location of the replication. If replication is being enabled, enabled must be provided. + Location *string + + // READ-ONLY; The cluster's replication creation time + CreatedDate *time.Time + + // READ-ONLY; The last time the cluster's replication was updated. + LastModifiedDate *time.Time + + // READ-ONLY; The provisioning state of the cluster replication. + ProvisioningState *ClusterReplicationState +} + // ClusterSKU - The cluster sku definition. type ClusterSKU struct { - // The capacity value + // The capacity reservation level in Gigabytes for this cluster. Capacity *Capacity - // The name of the SKU. + // The SKU (tier) of a cluster. Name *ClusterSKUNameEnum } @@ -473,22 +518,25 @@ type LinkedStorageAccountsResource struct { // LogAnalyticsQueryPack - An Log Analytics QueryPack definition. type LogAnalyticsQueryPack struct { - // REQUIRED; Resource location + // REQUIRED; The geo-location where the resource lives Location *string // REQUIRED; Properties that define a Log Analytics QueryPack resource. Properties *LogAnalyticsQueryPackProperties - // Resource tags + // Resource tags. Tags map[string]*string - // READ-ONLY; Azure resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string - // READ-ONLY; Azure resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -524,16 +572,16 @@ type LogAnalyticsQueryPackQuery struct { // Properties that define an Log Analytics QueryPack-Query resource. Properties *LogAnalyticsQueryPackQueryProperties - // READ-ONLY; Azure resource Id + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string - // READ-ONLY; Azure resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Read only system data + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData - // READ-ONLY; Azure resource type + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -613,6 +661,26 @@ type LogAnalyticsQueryPackQuerySearchPropertiesRelated struct { Solutions []*string } +// ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) +type ManagedServiceIdentity struct { + // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + Type *ManagedServiceIdentityType + + // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM + // resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + // The dictionary values can be empty objects ({}) in + // requests. + UserAssignedIdentities map[string]*UserAssignedIdentity + + // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned + // identity. + PrincipalID *string + + // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string +} + // ManagementGroup - A management group that is connected to a workspace type ManagementGroup struct { // The properties of the management group. @@ -655,6 +723,78 @@ type MetricName struct { Value *string } +// NetworkSecurityPerimeter - Information about a network security perimeter (NSP) +type NetworkSecurityPerimeter struct { + // Fully qualified Azure resource ID of the NSP resource + ID *string + + // Location of the network security perimeter + Location *string + + // Universal unique ID (UUID) of the network security perimeter + PerimeterGUID *string +} + +// NetworkSecurityPerimeterConfiguration - Network security perimeter (NSP) configuration resource +type NetworkSecurityPerimeterConfiguration struct { + // Network security configuration properties. + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkSecurityPerimeterConfigurationListResult - Result of a list NSP (network security perimeter) configurations request. +type NetworkSecurityPerimeterConfigurationListResult struct { + // The link used to get the next page of results. + NextLink *string + + // Array of network security perimeter results. + Value []*NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationProperties - Network security configuration properties. +type NetworkSecurityPerimeterConfigurationProperties struct { + // Information about a network security perimeter (NSP) + NetworkSecurityPerimeter *NetworkSecurityPerimeter + + // Network security perimeter configuration profile + Profile *NetworkSecurityProfile + + // Information about resource association + ResourceAssociation *ResourceAssociation + + // READ-ONLY; List of provisioning issues, if any + ProvisioningIssues []*ProvisioningIssue + + // READ-ONLY; Provisioning state of a network security perimeter configuration that is being created or updated. + ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState +} + +// NetworkSecurityProfile - Network security perimeter configuration profile +type NetworkSecurityProfile struct { + // List of Access Rules + AccessRules []*AccessRule + + // Current access rules version + AccessRulesVersion *int32 + + // Current diagnostic settings version + DiagnosticSettingsVersion *int32 + + // List of log categories that are enabled + EnabledLogCategories []*string + + // Name of the profile + Name *string +} + // Operation - Supported operation of OperationalInsights resource provider. type Operation struct { // Display metadata associated with the operation. @@ -718,6 +858,38 @@ type PrivateLinkScopedResource struct { ScopeID *string } +// ProvisioningIssue - Describes a provisioning issue for a network security perimeter configuration +type ProvisioningIssue struct { + // READ-ONLY; Name of the issue + Name *string + + // READ-ONLY; Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + // generate separate provisioning issue elements for each separate issue detected, and + // include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules + Properties *ProvisioningIssueProperties +} + +// ProvisioningIssueProperties - Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource +// providers should generate separate provisioning issue elements for each separate issue detected, and +// include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules +type ProvisioningIssueProperties struct { + // READ-ONLY; Description of the issue + Description *string + + // READ-ONLY; Type of issue + IssueType *IssueType + + // READ-ONLY; Severity of the issue. + Severity *Severity + + // READ-ONLY; Access rules that can be added to the network security profile (NSP) to remediate the issue. + SuggestedAccessRules []*AccessRule + + // READ-ONLY; Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + // (NSP) to remediate the issue. + SuggestedResourceIDs []*string +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -731,21 +903,19 @@ type ProxyResource struct { Type *string } -// QueryPacksResource - An azure resource object -type QueryPacksResource struct { - // REQUIRED; Resource location - Location *string - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Azure resource Id +// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have +// tags and a location +type ProxyResourceAutoGenerated struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string - // READ-ONLY; Azure resource name + // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure resource type + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -761,6 +931,30 @@ type Resource struct { Type *string } +// ResourceAssociation - Information about resource association +type ResourceAssociation struct { + // Access mode of the resource association + AccessMode *ResourceAssociationAccessMode + + // Name of the resource association + Name *string +} + +// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources +type ResourceAutoGenerated struct { + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // RestoredLogs - Restore parameters. type RestoredLogs struct { // The timestamp to end the restore by (UTC). @@ -771,6 +965,9 @@ type RestoredLogs struct { // The timestamp to start the restore from (UTC). StartRestoreTime *time.Time + + // READ-ONLY; Search results table async operation id. + AzureAsyncOperationID *string } // ResultStatistics - Search job execution statistics. @@ -780,6 +977,9 @@ type ResultStatistics struct { // READ-ONLY; Search job completion percentage. Progress *float32 + + // READ-ONLY; Search job: Amount of scanned data. + ScannedGb *float32 } // SavedSearch - Value object for saved search results. @@ -852,12 +1052,6 @@ type Schema struct { // READ-ONLY; Table labels. Labels []*string - // READ-ONLY; Parameters of the restore operation that initiated this table. - RestoredLogs *RestoredLogs - - // READ-ONLY; Parameters of the search job that initiated this table. - SearchResults *SearchResults - // READ-ONLY; List of solutions the table is affiliated with Solutions []*string @@ -964,6 +1158,9 @@ type SearchResults struct { // The timestamp to start the search from (UTC) StartSearchTime *time.Time + // READ-ONLY; Search results table async operation id. + AzureAsyncOperationID *string + // READ-ONLY; The table used in the search job. SourceTable *string } @@ -1073,29 +1270,8 @@ type StorageInsightStatus struct { Description *string } -// SystemData - Read only system data +// SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { - // The timestamp of resource creation (UTC) - CreatedAt *time.Time - - // An identifier for the identity that created the resource - CreatedBy *string - - // The type of identity that created the resource - CreatedByType *IdentityType - - // The timestamp of resource last modification (UTC) - LastModifiedAt *time.Time - - // An identifier for the identity that last modified the resource - LastModifiedBy *string - - // The type of identity that last modified the resource - LastModifiedByType *IdentityType -} - -// SystemDataAutoGenerated - Metadata pertaining to creation and last modification of the resource. -type SystemDataAutoGenerated struct { // The timestamp of resource creation (UTC). CreatedAt *time.Time @@ -1127,7 +1303,7 @@ type Table struct { Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemDataAutoGenerated + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string @@ -1141,9 +1317,6 @@ type TableProperties struct { // Parameters of the restore operation that initiated this table. RestoredLogs *RestoredLogs - // Search job execution statistics. - ResultStatistics *ResultStatistics - // The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention. RetentionInDays *int32 @@ -1153,7 +1326,7 @@ type TableProperties struct { // Parameters of the search job that initiated this table. SearchResults *SearchResults - // The table total retention in days, between 4 and 2555. Setting this property to -1 will default to table retention. + // The table total retention in days, between 4 and 4383. Setting this property to -1 will default to table retention. TotalRetentionInDays *int32 // READ-ONLY; The table data archive retention in days. Calculated as (totalRetentionInDays-retentionInDays) @@ -1165,6 +1338,15 @@ type TableProperties struct { // READ-ONLY; Table's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing operation, // forbidding any update to the table until the ongoing operation is concluded. ProvisioningState *ProvisioningStateEnum + + // READ-ONLY; Search job execution statistics. + ResultStatistics *ResultStatistics + + // READ-ONLY; True - Value originates from workspace retention in days, False - Customer specific. + RetentionInDaysAsDefault *bool + + // READ-ONLY; True - Value originates from retention in days, False - Customer specific. + TotalRetentionInDaysAsDefault *bool } // TablesListResult - The list tables operation response. @@ -1207,6 +1389,28 @@ type TrackedResource struct { Type *string } +// TrackedResourceAutoGenerated - The resource model definition for an Azure Resource Manager tracked top level resource which +// has 'tags' and a 'location' +type TrackedResourceAutoGenerated struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // UsageMetric - A metric describing the usage of a resource. type UsageMetric struct { // The current value of the metric. @@ -1228,6 +1432,15 @@ type UsageMetric struct { Unit *string } +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of the assigned identity. + PrincipalID *string +} + // UserIdentityProperties - User assigned identity properties. type UserIdentityProperties struct { // READ-ONLY; The client id of user assigned identity. @@ -1242,8 +1455,11 @@ type Workspace struct { // REQUIRED; The geo-location where the resource lives Location *string - // The ETag of the workspace. - ETag *string + // The etag of the workspace. + Etag *string + + // The identity of the resource. + Identity *Identity // Workspace properties. Properties *WorkspaceProperties @@ -1258,7 +1474,7 @@ type Workspace struct { Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemDataAutoGenerated + SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string @@ -1276,6 +1492,15 @@ type WorkspaceCapping struct { QuotaNextResetTime *string } +// WorkspaceFailoverProperties - The failover state of the replication. +type WorkspaceFailoverProperties struct { + // READ-ONLY; The last time when the failover state was updated. + LastModifiedDate *time.Time + + // READ-ONLY; The failover state of the replication. + State *WorkspaceFailoverState +} + // WorkspaceFeatures - Workspace features. type WorkspaceFeatures struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. @@ -1295,6 +1520,9 @@ type WorkspaceFeatures struct { // Flag that describes if we want to remove the data after 30 days. ImmediatePurgeDataOn30Days *bool + + // READ-ONLY; An indication if the specify workspace is limited to sentinel's unified billing model only. + UnifiedSentinelBillingOnly *bool } // WorkspaceListManagementGroupsResult - The list workspace management groups operation response. @@ -1317,6 +1545,9 @@ type WorkspaceListUsagesResult struct { // WorkspacePatch - The top level Workspace resource container. type WorkspacePatch struct { + // The identity of the resource. + Identity *Identity + // Workspace properties. Properties *WorkspaceProperties @@ -1342,6 +1573,9 @@ type WorkspaceProperties struct { // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. DefaultDataCollectionRuleResourceID *string + // workspace failover properties. + Failover *WorkspaceFailoverProperties + // Workspace features. Features *WorkspaceFeatures @@ -1354,6 +1588,9 @@ type WorkspaceProperties struct { // The network access type for accessing Log Analytics query. PublicNetworkAccessForQuery *PublicNetworkAccessType + // workspace replication properties. + Replication *WorkspaceReplicationProperties + // The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers documentation for details. RetentionInDays *int32 @@ -1364,13 +1601,13 @@ type WorkspaceProperties struct { WorkspaceCapping *WorkspaceCapping // READ-ONLY; Workspace creation date. - CreatedDate *string + CreatedDate *time.Time // READ-ONLY; This is a read-only property. Represents the ID associated with the workspace. CustomerID *string // READ-ONLY; Workspace modification date. - ModifiedDate *string + ModifiedDate *time.Time // READ-ONLY; List of linked private link scope resources. PrivateLinkScopedResources []*PrivateLinkScopedResource @@ -1417,6 +1654,44 @@ type WorkspacePurgeStatusResponse struct { Status *PurgeState } +// WorkspaceReplicationPatProperties - Workspace replication properties. +type WorkspaceReplicationPatProperties struct { + // Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated to the specified + // location. + Enabled *bool + + // The location of the replication. + Location *string + + // READ-ONLY; The last time when the replication was enabled. + CreatedDate *time.Time + + // READ-ONLY; The last time when the replication was updated. + LastModifiedDate *time.Time + + // READ-ONLY; The provisioning state of the replication. + ProvisioningState *WorkspaceReplicationState +} + +// WorkspaceReplicationProperties - Workspace replication properties. +type WorkspaceReplicationProperties struct { + // Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated to the specified + // location. If replication is been enabled, location must be provided. + Enabled *bool + + // The location of the replication. + Location *string + + // READ-ONLY; The last time when the replication was enabled. + CreatedDate *time.Time + + // READ-ONLY; The last time when the replication was updated. + LastModifiedDate *time.Time + + // READ-ONLY; The provisioning state of the replication. + ProvisioningState *WorkspaceReplicationState +} + // WorkspaceSKU - The SKU (tier) of a workspace. type WorkspaceSKU struct { // REQUIRED; The name of the SKU. @@ -1426,5 +1701,5 @@ type WorkspaceSKU struct { CapacityReservationLevel *CapacityReservationLevel // READ-ONLY; The last time when the sku was updated. - LastSKUUpdate *string + LastSKUUpdate *time.Time } diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go index 69f020a78776..dc86982d0705 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/models_serde.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -15,10 +12,119 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AccessRule. +func (a AccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRule. +func (a *AccessRule) 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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AccessRuleProperties. +func (a AccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addressPrefixes", a.AddressPrefixes) + populate(objectMap, "direction", a.Direction) + populate(objectMap, "emailAddresses", a.EmailAddresses) + populate(objectMap, "fullyQualifiedDomainNames", a.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", a.NetworkSecurityPerimeters) + populate(objectMap, "phoneNumbers", a.PhoneNumbers) + populate(objectMap, "subscriptions", a.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRuleProperties. +func (a *AccessRuleProperties) 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 "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &a.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &a.Direction) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &a.EmailAddresses) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &a.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &a.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "phoneNumbers": + err = unpopulate(val, "PhoneNumbers", &a.PhoneNumbers) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &a.Subscriptions) + 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 AccessRulePropertiesSubscriptionsItem. +func (a AccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessRulePropertiesSubscriptionsItem. +func (a *AccessRulePropertiesSubscriptionsItem) 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AssociatedWorkspace. func (a AssociatedWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "associateDate", a.AssociateDate) + populateDateTimeRFC3339(objectMap, "associateDate", a.AssociateDate) populate(objectMap, "resourceId", a.ResourceID) populate(objectMap, "workspaceId", a.WorkspaceID) populate(objectMap, "workspaceName", a.WorkspaceName) @@ -35,7 +141,7 @@ func (a *AssociatedWorkspace) UnmarshalJSON(data []byte) error { var err error switch key { case "associateDate": - err = unpopulate(val, "AssociateDate", &a.AssociateDate) + err = unpopulateDateTimeRFC3339(val, "AssociateDate", &a.AssociateDate) delete(rawMsg, key) case "resourceId": err = unpopulate(val, "ResourceID", &a.ResourceID) @@ -144,49 +250,10 @@ func (a *AzureEntityResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceProperties. -func (a AzureResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceProperties. -func (a *AzureResourceProperties) 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 "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - 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 CapacityReservationProperties. func (c CapacityReservationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "lastSkuUpdate", c.LastSKUUpdate) + populateDateTimeRFC3339(objectMap, "lastSkuUpdate", c.LastSKUUpdate) populate(objectMap, "minCapacity", c.MinCapacity) return json.Marshal(objectMap) } @@ -201,7 +268,7 @@ func (c *CapacityReservationProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "lastSkuUpdate": - err = unpopulate(val, "LastSKUUpdate", &c.LastSKUUpdate) + err = unpopulateDateTimeRFC3339(val, "LastSKUUpdate", &c.LastSKUUpdate) delete(rawMsg, key) case "minCapacity": err = unpopulate(val, "MinCapacity", &c.MinCapacity) @@ -377,12 +444,13 @@ func (c ClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "billingType", c.BillingType) populate(objectMap, "capacityReservationProperties", c.CapacityReservationProperties) populate(objectMap, "clusterId", c.ClusterID) - populate(objectMap, "createdDate", c.CreatedDate) + populateDateTimeRFC3339(objectMap, "createdDate", c.CreatedDate) populate(objectMap, "isAvailabilityZonesEnabled", c.IsAvailabilityZonesEnabled) populate(objectMap, "isDoubleEncryptionEnabled", c.IsDoubleEncryptionEnabled) populate(objectMap, "keyVaultProperties", c.KeyVaultProperties) - populate(objectMap, "lastModifiedDate", c.LastModifiedDate) + populateDateTimeRFC3339(objectMap, "lastModifiedDate", c.LastModifiedDate) populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "replication", c.Replication) return json.Marshal(objectMap) } @@ -408,7 +476,7 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ClusterID", &c.ClusterID) delete(rawMsg, key) case "createdDate": - err = unpopulate(val, "CreatedDate", &c.CreatedDate) + err = unpopulateDateTimeRFC3339(val, "CreatedDate", &c.CreatedDate) delete(rawMsg, key) case "isAvailabilityZonesEnabled": err = unpopulate(val, "IsAvailabilityZonesEnabled", &c.IsAvailabilityZonesEnabled) @@ -420,7 +488,57 @@ func (c *ClusterProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "KeyVaultProperties", &c.KeyVaultProperties) delete(rawMsg, key) case "lastModifiedDate": - err = unpopulate(val, "LastModifiedDate", &c.LastModifiedDate) + err = unpopulateDateTimeRFC3339(val, "LastModifiedDate", &c.LastModifiedDate) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "replication": + err = unpopulate(val, "Replication", &c.Replication) + 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 ClusterReplicationProperties. +func (c ClusterReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdDate", c.CreatedDate) + populate(objectMap, "enabled", c.Enabled) + populate(objectMap, "isAvailabilityZonesEnabled", c.IsAvailabilityZonesEnabled) + populateDateTimeRFC3339(objectMap, "lastModifiedDate", c.LastModifiedDate) + populate(objectMap, "location", c.Location) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterReplicationProperties. +func (c *ClusterReplicationProperties) 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 "createdDate": + err = unpopulateDateTimeRFC3339(val, "CreatedDate", &c.CreatedDate) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &c.Enabled) + delete(rawMsg, key) + case "isAvailabilityZonesEnabled": + err = unpopulate(val, "IsAvailabilityZonesEnabled", &c.IsAvailabilityZonesEnabled) + delete(rawMsg, key) + case "lastModifiedDate": + err = unpopulateDateTimeRFC3339(val, "LastModifiedDate", &c.LastModifiedDate) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) @@ -1253,6 +1371,7 @@ func (l LogAnalyticsQueryPack) MarshalJSON() ([]byte, error) { populate(objectMap, "location", l.Location) populate(objectMap, "name", l.Name) populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) populate(objectMap, "tags", l.Tags) populate(objectMap, "type", l.Type) return json.Marshal(objectMap) @@ -1279,6 +1398,9 @@ func (l *LogAnalyticsQueryPack) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &l.Tags) delete(rawMsg, key) @@ -1601,6 +1723,45 @@ func (l *LogAnalyticsQueryPackQuerySearchPropertiesRelated) UnmarshalJSON(data [ return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) 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 "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + 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 ManagementGroup. func (m ManagementGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1714,164 +1875,355 @@ func (m *MetricName) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter. +func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter. +func (n *NetworkSecurityPerimeter) 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) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n *NetworkSecurityPerimeterConfigurationListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.Value) + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationStatus. -func (o OperationStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endTime", o.EndTime) - populate(objectMap, "error", o.Error) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "startTime", o.StartTime) - populate(objectMap, "status", o.Status) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. -func (o *OperationStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulate(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &o.StartTime) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopedResource. -func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityProfile. +func (n NetworkSecurityProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resourceId", p.ResourceID) - populate(objectMap, "scopeId", p.ScopeID) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "diagnosticSettingsVersion", n.DiagnosticSettingsVersion) + populate(objectMap, "enabledLogCategories", n.EnabledLogCategories) + populate(objectMap, "name", n.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource. -func (p *PrivateLinkScopedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityProfile. +func (n *NetworkSecurityProfile) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "diagnosticSettingsVersion": + err = unpopulate(val, "DiagnosticSettingsVersion", &n.DiagnosticSettingsVersion) + delete(rawMsg, key) + case "enabledLogCategories": + err = unpopulate(val, "EnabledLogCategories", &n.EnabledLogCategories) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + 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) + } + 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]any) + 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]any) + 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 OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) 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 = unpopulate(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 "startTime": + err = unpopulate(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 PrivateLinkScopedResource. +func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", p.ResourceID) + populate(objectMap, "scopeId", p.ScopeID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource. +func (p *PrivateLinkScopedResource) 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) @@ -1893,6 +2245,80 @@ func (p *PrivateLinkScopedResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) 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 "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) + populate(objectMap, "severity", p.Severity) + populate(objectMap, "suggestedAccessRules", p.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", p.SuggestedResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) 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 "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &p.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &p.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &p.SuggestedResourceIDs) + 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 ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1902,86 +2328,149 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "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 ProxyResourceAutoGenerated. +func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated. +func (p *ProxyResourceAutoGenerated) 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 "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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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) + 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", &p.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueryPacksResource. -func (q QueryPacksResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceAssociation. +func (r ResourceAssociation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", q.ID) - populate(objectMap, "location", q.Location) - populate(objectMap, "name", q.Name) - populate(objectMap, "tags", q.Tags) - populate(objectMap, "type", q.Type) + populate(objectMap, "accessMode", r.AccessMode) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryPacksResource. -func (q *QueryPacksResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAssociation. +func (r *ResourceAssociation) 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", q, err) + 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", &q.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &q.Location) + case "accessMode": + err = unpopulate(val, "AccessMode", &r.AccessMode) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &q.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &q.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &q.Type) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. +func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. +func (r *ResourceAutoGenerated) 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) @@ -1995,6 +2484,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -2009,6 +2501,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RestoredLogs. func (r RestoredLogs) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "azureAsyncOperationId", r.AzureAsyncOperationID) populateDateTimeRFC3339(objectMap, "endRestoreTime", r.EndRestoreTime) populate(objectMap, "sourceTable", r.SourceTable) populateDateTimeRFC3339(objectMap, "startRestoreTime", r.StartRestoreTime) @@ -2024,6 +2517,9 @@ func (r *RestoredLogs) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "azureAsyncOperationId": + err = unpopulate(val, "AzureAsyncOperationID", &r.AzureAsyncOperationID) + delete(rawMsg, key) case "endRestoreTime": err = unpopulateDateTimeRFC3339(val, "EndRestoreTime", &r.EndRestoreTime) delete(rawMsg, key) @@ -2046,6 +2542,7 @@ func (r ResultStatistics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "ingestedRecords", r.IngestedRecords) populate(objectMap, "progress", r.Progress) + populate(objectMap, "scannedGb", r.ScannedGb) return json.Marshal(objectMap) } @@ -2064,6 +2561,9 @@ func (r *ResultStatistics) UnmarshalJSON(data []byte) error { case "progress": err = unpopulate(val, "Progress", &r.Progress) delete(rawMsg, key) + case "scannedGb": + err = unpopulate(val, "ScannedGb", &r.ScannedGb) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -2202,8 +2702,6 @@ func (s Schema) MarshalJSON() ([]byte, error) { populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "labels", s.Labels) populate(objectMap, "name", s.Name) - populate(objectMap, "restoredLogs", s.RestoredLogs) - populate(objectMap, "searchResults", s.SearchResults) populate(objectMap, "solutions", s.Solutions) populate(objectMap, "source", s.Source) populate(objectMap, "standardColumns", s.StandardColumns) @@ -2239,12 +2737,6 @@ func (s *Schema) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "restoredLogs": - err = unpopulate(val, "RestoredLogs", &s.RestoredLogs) - delete(rawMsg, key) - case "searchResults": - err = unpopulate(val, "SearchResults", &s.SearchResults) - delete(rawMsg, key) case "solutions": err = unpopulate(val, "Solutions", &s.Solutions) delete(rawMsg, key) @@ -2424,6 +2916,7 @@ func (s *SearchMetadataSchema) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SearchResults. func (s SearchResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "azureAsyncOperationId", s.AzureAsyncOperationID) populate(objectMap, "description", s.Description) populateDateTimeRFC3339(objectMap, "endSearchTime", s.EndSearchTime) populate(objectMap, "limit", s.Limit) @@ -2442,6 +2935,9 @@ func (s *SearchResults) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "azureAsyncOperationId": + err = unpopulate(val, "AzureAsyncOperationID", &s.AzureAsyncOperationID) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) @@ -2807,53 +3303,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. -func (s SystemDataAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(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 SystemDataAutoGenerated. -func (s *SystemDataAutoGenerated) 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 = unpopulateDateTimeRFC3339(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 = unpopulateDateTimeRFC3339(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 Table. func (t Table) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2907,9 +3356,11 @@ func (t TableProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "restoredLogs", t.RestoredLogs) populate(objectMap, "resultStatistics", t.ResultStatistics) populate(objectMap, "retentionInDays", t.RetentionInDays) + populate(objectMap, "retentionInDaysAsDefault", t.RetentionInDaysAsDefault) populate(objectMap, "schema", t.Schema) populate(objectMap, "searchResults", t.SearchResults) populate(objectMap, "totalRetentionInDays", t.TotalRetentionInDays) + populate(objectMap, "totalRetentionInDaysAsDefault", t.TotalRetentionInDaysAsDefault) return json.Marshal(objectMap) } @@ -2943,6 +3394,9 @@ func (t *TableProperties) UnmarshalJSON(data []byte) error { case "retentionInDays": err = unpopulate(val, "RetentionInDays", &t.RetentionInDays) delete(rawMsg, key) + case "retentionInDaysAsDefault": + err = unpopulate(val, "RetentionInDaysAsDefault", &t.RetentionInDaysAsDefault) + delete(rawMsg, key) case "schema": err = unpopulate(val, "Schema", &t.Schema) delete(rawMsg, key) @@ -2952,6 +3406,9 @@ func (t *TableProperties) UnmarshalJSON(data []byte) error { case "totalRetentionInDays": err = unpopulate(val, "TotalRetentionInDays", &t.TotalRetentionInDays) delete(rawMsg, key) + case "totalRetentionInDaysAsDefault": + err = unpopulate(val, "TotalRetentionInDaysAsDefault", &t.TotalRetentionInDaysAsDefault) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -3088,6 +3545,53 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TrackedResourceAutoGenerated. +func (t TrackedResourceAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResourceAutoGenerated. +func (t *TrackedResourceAutoGenerated) 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 "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + 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 UsageMetric. func (u UsageMetric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3135,6 +3639,37 @@ func (u *UsageMetric) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) 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", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties. func (u UserIdentityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3169,8 +3704,9 @@ func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Workspace. func (w Workspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "eTag", w.ETag) + populate(objectMap, "etag", w.Etag) populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) populate(objectMap, "location", w.Location) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) @@ -3189,12 +3725,15 @@ func (w *Workspace) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &w.ETag) + case "etag": + err = unpopulate(val, "Etag", &w.Etag) delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &w.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &w.Location) delete(rawMsg, key) @@ -3256,6 +3795,37 @@ func (w *WorkspaceCapping) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceFailoverProperties. +func (w WorkspaceFailoverProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "lastModifiedDate", w.LastModifiedDate) + populate(objectMap, "state", w.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceFailoverProperties. +func (w *WorkspaceFailoverProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "lastModifiedDate": + err = unpopulateDateTimeRFC3339(val, "LastModifiedDate", &w.LastModifiedDate) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &w.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceFeatures. func (w WorkspaceFeatures) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3264,6 +3834,7 @@ func (w WorkspaceFeatures) MarshalJSON() ([]byte, error) { populate(objectMap, "enableDataExport", w.EnableDataExport) populate(objectMap, "enableLogAccessUsingOnlyResourcePermissions", w.EnableLogAccessUsingOnlyResourcePermissions) populate(objectMap, "immediatePurgeDataOn30Days", w.ImmediatePurgeDataOn30Days) + populate(objectMap, "unifiedSentinelBillingOnly", w.UnifiedSentinelBillingOnly) if w.AdditionalProperties != nil { for key, val := range w.AdditionalProperties { objectMap[key] = val @@ -3296,6 +3867,9 @@ func (w *WorkspaceFeatures) UnmarshalJSON(data []byte) error { case "immediatePurgeDataOn30Days": err = unpopulate(val, "ImmediatePurgeDataOn30Days", &w.ImmediatePurgeDataOn30Days) delete(rawMsg, key) + case "unifiedSentinelBillingOnly": + err = unpopulate(val, "UnifiedSentinelBillingOnly", &w.UnifiedSentinelBillingOnly) + delete(rawMsg, key) default: if w.AdditionalProperties == nil { w.AdditionalProperties = map[string]any{} @@ -3400,6 +3974,7 @@ func (w WorkspacePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "etag", w.Etag) populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) populate(objectMap, "tags", w.Tags) @@ -3422,6 +3997,9 @@ func (w *WorkspacePatch) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &w.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &w.Name) delete(rawMsg, key) @@ -3445,16 +4023,18 @@ func (w *WorkspacePatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "createdDate", w.CreatedDate) + populateDateTimeRFC3339(objectMap, "createdDate", w.CreatedDate) populate(objectMap, "customerId", w.CustomerID) populate(objectMap, "defaultDataCollectionRuleResourceId", w.DefaultDataCollectionRuleResourceID) + populate(objectMap, "failover", w.Failover) populate(objectMap, "features", w.Features) populate(objectMap, "forceCmkForQuery", w.ForceCmkForQuery) - populate(objectMap, "modifiedDate", w.ModifiedDate) + populateDateTimeRFC3339(objectMap, "modifiedDate", w.ModifiedDate) populate(objectMap, "privateLinkScopedResources", w.PrivateLinkScopedResources) populate(objectMap, "provisioningState", w.ProvisioningState) populate(objectMap, "publicNetworkAccessForIngestion", w.PublicNetworkAccessForIngestion) populate(objectMap, "publicNetworkAccessForQuery", w.PublicNetworkAccessForQuery) + populate(objectMap, "replication", w.Replication) populate(objectMap, "retentionInDays", w.RetentionInDays) populate(objectMap, "sku", w.SKU) populate(objectMap, "workspaceCapping", w.WorkspaceCapping) @@ -3471,7 +4051,7 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { var err error switch key { case "createdDate": - err = unpopulate(val, "CreatedDate", &w.CreatedDate) + err = unpopulateDateTimeRFC3339(val, "CreatedDate", &w.CreatedDate) delete(rawMsg, key) case "customerId": err = unpopulate(val, "CustomerID", &w.CustomerID) @@ -3479,6 +4059,9 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "defaultDataCollectionRuleResourceId": err = unpopulate(val, "DefaultDataCollectionRuleResourceID", &w.DefaultDataCollectionRuleResourceID) delete(rawMsg, key) + case "failover": + err = unpopulate(val, "Failover", &w.Failover) + delete(rawMsg, key) case "features": err = unpopulate(val, "Features", &w.Features) delete(rawMsg, key) @@ -3486,7 +4069,7 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { err = unpopulate(val, "ForceCmkForQuery", &w.ForceCmkForQuery) delete(rawMsg, key) case "modifiedDate": - err = unpopulate(val, "ModifiedDate", &w.ModifiedDate) + err = unpopulateDateTimeRFC3339(val, "ModifiedDate", &w.ModifiedDate) delete(rawMsg, key) case "privateLinkScopedResources": err = unpopulate(val, "PrivateLinkScopedResources", &w.PrivateLinkScopedResources) @@ -3500,6 +4083,9 @@ func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error { case "publicNetworkAccessForQuery": err = unpopulate(val, "PublicNetworkAccessForQuery", &w.PublicNetworkAccessForQuery) delete(rawMsg, key) + case "replication": + err = unpopulate(val, "Replication", &w.Replication) + delete(rawMsg, key) case "retentionInDays": err = unpopulate(val, "RetentionInDays", &w.RetentionInDays) delete(rawMsg, key) @@ -3641,11 +4227,97 @@ func (w *WorkspacePurgeStatusResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkspaceReplicationPatProperties. +func (w WorkspaceReplicationPatProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdDate", w.CreatedDate) + populate(objectMap, "enabled", w.Enabled) + populateDateTimeRFC3339(objectMap, "lastModifiedDate", w.LastModifiedDate) + populate(objectMap, "location", w.Location) + populate(objectMap, "provisioningState", w.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceReplicationPatProperties. +func (w *WorkspaceReplicationPatProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateDateTimeRFC3339(val, "CreatedDate", &w.CreatedDate) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &w.Enabled) + delete(rawMsg, key) + case "lastModifiedDate": + err = unpopulateDateTimeRFC3339(val, "LastModifiedDate", &w.LastModifiedDate) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceReplicationProperties. +func (w WorkspaceReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdDate", w.CreatedDate) + populate(objectMap, "enabled", w.Enabled) + populateDateTimeRFC3339(objectMap, "lastModifiedDate", w.LastModifiedDate) + populate(objectMap, "location", w.Location) + populate(objectMap, "provisioningState", w.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceReplicationProperties. +func (w *WorkspaceReplicationProperties) 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", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdDate": + err = unpopulateDateTimeRFC3339(val, "CreatedDate", &w.CreatedDate) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &w.Enabled) + delete(rawMsg, key) + case "lastModifiedDate": + err = unpopulateDateTimeRFC3339(val, "LastModifiedDate", &w.LastModifiedDate) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WorkspaceSKU. func (w WorkspaceSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "capacityReservationLevel", w.CapacityReservationLevel) - populate(objectMap, "lastSkuUpdate", w.LastSKUUpdate) + populateDateTimeRFC3339(objectMap, "lastSkuUpdate", w.LastSKUUpdate) populate(objectMap, "name", w.Name) return json.Marshal(objectMap) } @@ -3663,7 +4335,7 @@ func (w *WorkspaceSKU) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CapacityReservationLevel", &w.CapacityReservationLevel) delete(rawMsg, key) case "lastSkuUpdate": - err = unpopulate(val, "LastSKUUpdate", &w.LastSKUUpdate) + err = unpopulateDateTimeRFC3339(val, "LastSKUUpdate", &w.LastSKUUpdate) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &w.Name) diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go index 059c62ca42b7..33df88323c2b 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available OperationalInsights Rest API operations. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.OperationalInsights/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client_example_test.go deleted file mode 100644 index 207ec64d6a9e..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operations_client_example_test.go +++ /dev/null @@ -1,366 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/OperationsListByTenant.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armoperationalinsights.OperationListResult{ - // Value: []*armoperationalinsights.Operation{ - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/write"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Creates a new workspace or links to an existing workspace by providing the customer id from the existing workspace."), - // Operation: to.Ptr("Create Workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Workspace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Gets an existing workspace"), - // Operation: to.Ptr("Get Workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Workspace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/delete"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Deletes a workspace. If the workspace was linked to an existing workspace at creation time then the workspace it was linked to is not deleted."), - // Operation: to.Ptr("Delete Workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Workspace"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/generateregistrationcertificate/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Generates Registration Certificate for the workspace. This Certificate is used to connect Microsoft System Center Operation Manager to the workspace."), - // Operation: to.Ptr("Generates Registration Certificate for Workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Registration Certificate"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/storageinsightconfigs/write"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Creates a new storage configuration. These configurations are used to pull data from a location in an existing storage account."), - // Operation: to.Ptr("Create Storage Configuration"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Storage Insight Configuration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/storageinsightconfigs/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Gets a storage configuration."), - // Operation: to.Ptr("Get Storage Configuration"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Storage Insight Configuration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/storageinsightconfigs/delete"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Deletes a storage configuration. This will stop Microsoft Operational Insights from reading data from the storage account."), - // Operation: to.Ptr("Delete Storage Configuration"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Storage Insight Configuration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/register/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Register a subscription to a resource provider."), - // Operation: to.Ptr("Register a subscription to a resource provider."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Register"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/sharedKeys/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Retrieves the shared keys for the workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace."), - // Operation: to.Ptr("List Workspace Shared Keys"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Shared Keys"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/sharedKeys/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Retrieves the shared keys for the workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace."), - // Operation: to.Ptr("List Workspace Shared Keys"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Shared Keys"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/listKeys/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Retrieves the list keys for the workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace."), - // Operation: to.Ptr("List Workspace Keys"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("List Keys"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/listKeys/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Retrieves the list keys for the workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace."), - // Operation: to.Ptr("List Workspace Keys"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("List Keys"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/managementGroups/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Gets the names and metadata for System Center Operations Manager management groups connected to this workspace."), - // Operation: to.Ptr("Get Management Groups for Workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Management Group"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/usages/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Gets usage data for a workspace including the amount of data read by the workspace."), - // Operation: to.Ptr("Get Usage Data for Workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Usage Metric"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/search/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Executes a search query"), - // Operation: to.Ptr("Search Workspace Data"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Search"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/schema/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Gets the search schema for the workspace. Search schema includes the exposed fields and their types."), - // Operation: to.Ptr("Get Search Schema"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Search Schema"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get datasources under a workspace."), - // Operation: to.Ptr("Get datasources under a workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Data Source"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/datasources/write"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Create/Update datasources under a workspace."), - // Operation: to.Ptr("Create/Update datasources under a workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Data Source"), - // }, - // }, - // { - // }, - // { - // }, - // { - // }, - // { - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/notificationSettings/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get the user's notification settings for the workspace."), - // Operation: to.Ptr("Get Notification Settings"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Notification Settings"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/notificationSettings/write"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Set the user's notification settings for the workspace."), - // Operation: to.Ptr("Put Notification Settings"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Notification Settings"), - // }, - // }, - // { - // }, - // { - // }, - // { - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/configurationScopes/delete"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Delete Configuration Scope"), - // Operation: to.Ptr("Delete Configuration Scope"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Configuration Scope"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get linked services under given workspace."), - // Operation: to.Ptr("Get linked services under given workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Linked Services"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices/write"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Create/Update linked services under given workspace."), - // Operation: to.Ptr("Create/Update linked services under given workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Linked Services"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/linkedServices/delete"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Delete linked services under given workspace."), - // Operation: to.Ptr("Delete linked services under given workspace."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Linked Services"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/intelligencepacks/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Lists all intelligence packs that are visible for a given worksapce and also lists whether the pack is enabled or disabled for that workspace."), - // Operation: to.Ptr("List Intelligence Packs"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Intelligence Packs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/intelligencepacks/enable/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Enables an intelligence pack for a given workspace."), - // Operation: to.Ptr("Enable Intelligence Pack"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Intelligence Packs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/intelligencepacks/disable/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Disables an intelligence pack for a given workspace."), - // Operation: to.Ptr("Disable Intelligence Pack"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Intelligence Packs"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/analytics/query/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Search using new engine."), - // Operation: to.Ptr("Search using new engine."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("analytics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/analytics/query/schema/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get search schema V2."), - // Operation: to.Ptr("Get search schema V2."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("analytics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/api/query/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Search using new engine."), - // Operation: to.Ptr("Search using new engine."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("analytics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/api/query/schema/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get search schema V2."), - // Operation: to.Ptr("Get search schema V2."), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("analytics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/purge/action"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Delete specified data from workspace"), - // Operation: to.Ptr("Delete specified data from workspace"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("analytics"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/linkTargets/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Lists existing accounts that are not associated with an Azure subscription. To link this Azure subscription to a workspace, use a customer id returned by this operation in the customer id property of the Create Workspace operation."), - // Operation: to.Ptr("List Unlinked Accounts"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Unlinked Account"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.OperationalInsights/workspaces/metricDefinitions/read"), - // Display: &armoperationalinsights.OperationDisplay{ - // Description: to.Ptr("Get Metric Definitions under workspace"), - // Operation: to.Ptr("Metric Definition operation"), - // Provider: to.Ptr("Microsoft Operational Insights"), - // Resource: to.Ptr("Metric Definitions"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go index ad614a1a6715..f89430276a2f 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewOperationStatusesClient(subscriptionID string, credential azcore.TokenCr // Get - Get the status of a long running azure asynchronous operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - location - The region name of operation. // - asyncOperationID - The operation Id. // - options - OperationStatusesClientGetOptions contains the optional parameters for the OperationStatusesClient.Get method. @@ -73,7 +70,7 @@ func (client *OperationStatusesClient) Get(ctx context.Context, location string, } // getCreateRequest creates the Get request. -func (client *OperationStatusesClient) getCreateRequest(ctx context.Context, location string, asyncOperationID string, options *OperationStatusesClientGetOptions) (*policy.Request, error) { +func (client *OperationStatusesClient) getCreateRequest(ctx context.Context, location string, asyncOperationID string, _ *OperationStatusesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -92,7 +89,7 @@ func (client *OperationStatusesClient) getCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client_example_test.go deleted file mode 100644 index c940992c3657..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/operationstatuses_client_example_test.go +++ /dev/null @@ -1,45 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json -func ExampleOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationStatusesClient().Get(ctx, "West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armoperationalinsights.OperationStatus{ - // Name: to.Ptr("713192d7-503f-477a-9cfe-4efc3ee2bd11"), - // EndTime: to.Ptr("2017-01-01T16:13:13.933Z"), - // ID: to.Ptr("/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/locations/westus/operationStatuses/713192d7-503f-477a-9cfe-4efc3ee2bd11"), - // StartTime: to.Ptr("2017-01-01T13:13:13.933Z"), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/options.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/options.go index 14634ce61d74..01cf4acc26f0 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/options.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/options.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,19 +13,19 @@ type AvailableServiceTiersClientListByWorkspaceOptions struct { // ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate method. type ClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. type ClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. type ClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -125,13 +122,13 @@ type IntelligencePacksClientListOptions struct { // LinkedServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the LinkedServicesClient.BeginCreateOrUpdate // method. type LinkedServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // LinkedServicesClientBeginDeleteOptions contains the optional parameters for the LinkedServicesClient.BeginDelete method. type LinkedServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -324,22 +321,27 @@ type StorageInsightConfigsClientListByWorkspaceOptions struct { // TablesClientBeginCreateOrUpdateOptions contains the optional parameters for the TablesClient.BeginCreateOrUpdate method. type TablesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // TablesClientBeginDeleteOptions contains the optional parameters for the TablesClient.BeginDelete method. type TablesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // TablesClientBeginUpdateOptions contains the optional parameters for the TablesClient.BeginUpdate method. type TablesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } +// TablesClientCancelSearchOptions contains the optional parameters for the TablesClient.CancelSearch method. +type TablesClientCancelSearchOptions struct { + // placeholder for future optional parameters +} + // TablesClientGetOptions contains the optional parameters for the TablesClient.Get method. type TablesClientGetOptions struct { // placeholder for future optional parameters @@ -374,7 +376,7 @@ type WorkspacePurgeClientPurgeOptions struct { // WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate // method. type WorkspacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -383,10 +385,21 @@ type WorkspacesClientBeginDeleteOptions struct { // Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. Force *bool - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginReconcileNSPOptions contains the optional parameters for the WorkspacesClient.BeginReconcileNSP method. +type WorkspacesClientBeginReconcileNSPOptions struct { + // Resumes the long-running operation from the provided token. ResumeToken string } +// WorkspacesClientGetNSPOptions contains the optional parameters for the WorkspacesClient.GetNSP method. +type WorkspacesClientGetNSPOptions struct { + // placeholder for future optional parameters +} + // WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. type WorkspacesClientGetOptions struct { // placeholder for future optional parameters @@ -398,6 +411,11 @@ type WorkspacesClientListByResourceGroupOptions struct { // placeholder for future optional parameters } +// WorkspacesClientListNSPOptions contains the optional parameters for the WorkspacesClient.NewListNSPPager method. +type WorkspacesClientListNSPOptions struct { + // placeholder for future optional parameters +} + // WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method. type WorkspacesClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go index 6e274d29cf42..c4bc981d1393 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewQueriesClient(subscriptionID string, credential azcore.TokenCredential, // Delete - Deletes a specific Query defined within an Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - id - The id of a specific query defined in the Log Analytics QueryPack @@ -74,7 +71,7 @@ func (client *QueriesClient) Delete(ctx context.Context, resourceGroupName strin } // deleteCreateRequest creates the Delete request. -func (client *QueriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientDeleteOptions) (*policy.Request, error) { +func (client *QueriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, _ *QueriesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +94,7 @@ func (client *QueriesClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +103,7 @@ func (client *QueriesClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - id - The id of a specific query defined in the Log Analytics QueryPack @@ -134,7 +131,7 @@ func (client *QueriesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *QueriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientGetOptions) (*policy.Request, error) { +func (client *QueriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, _ *QueriesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -157,7 +154,7 @@ func (client *QueriesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +171,7 @@ func (client *QueriesClient) getHandleResponse(resp *http.Response) (QueriesClie // NewListPager - Gets a list of Queries defined within a Log Analytics QueryPack. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - options - QueriesClientListOptions contains the optional parameters for the QueriesClient.NewListPager method. @@ -227,7 +224,7 @@ func (client *QueriesClient) listCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") if options != nil && options.IncludeBody != nil { reqQP.Set("includeBody", strconv.FormatBool(*options.IncludeBody)) } @@ -248,7 +245,7 @@ func (client *QueriesClient) listHandleResponse(resp *http.Response) (QueriesCli // Put - Adds or Updates a specific Query within a Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - id - The id of a specific query defined in the Log Analytics QueryPack @@ -277,7 +274,7 @@ func (client *QueriesClient) Put(ctx context.Context, resourceGroupName string, } // putCreateRequest creates the Put request. -func (client *QueriesClient) putCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientPutOptions) (*policy.Request, error) { +func (client *QueriesClient) putCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, _ *QueriesClientPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -300,7 +297,7 @@ func (client *QueriesClient) putCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, queryPayload); err != nil { @@ -320,7 +317,7 @@ func (client *QueriesClient) putHandleResponse(resp *http.Response) (QueriesClie // NewSearchPager - Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - querySearchProperties - Properties by which to search queries in the given Log Analytics QueryPack. @@ -374,7 +371,7 @@ func (client *QueriesClient) searchCreateRequest(ctx context.Context, resourceGr if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") if options != nil && options.IncludeBody != nil { reqQP.Set("includeBody", strconv.FormatBool(*options.IncludeBody)) } @@ -398,7 +395,7 @@ func (client *QueriesClient) searchHandleResponse(resp *http.Response) (QueriesC // Update - Adds or Updates a specific Query within a Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - id - The id of a specific query defined in the Log Analytics QueryPack @@ -427,7 +424,7 @@ func (client *QueriesClient) Update(ctx context.Context, resourceGroupName strin } // updateCreateRequest creates the Update request. -func (client *QueriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientUpdateOptions) (*policy.Request, error) { +func (client *QueriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, _ *QueriesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -450,7 +447,7 @@ func (client *QueriesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, queryPayload); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client_example_test.go deleted file mode 100644 index 69e3b48d468b..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/queries_client_example_test.go +++ /dev/null @@ -1,470 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesList.json -func ExampleQueriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueriesClient().NewListPager("my-resource-group", "my-querypack", &armoperationalinsights.QueriesClientListOptions{Top: nil, - IncludeBody: to.Ptr(true), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogAnalyticsQueryPackQueryListResult = armoperationalinsights.LogAnalyticsQueryPackQueryListResult{ - // Value: []*armoperationalinsights.LogAnalyticsQueryPackQuery{ - // { - // Name: to.Ptr("4337bb16-d6fe-4ff7-97cf-59df25941476"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/4337bb16-d6fe-4ff7-97cf-59df25941476"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("heartbeat | take 10"), - // DisplayName: to.Ptr("Heartbeat_1"), - // ID: to.Ptr("4337bb16-d6fe-4ff7-97cf-59df25941476"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:29:56.103Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:29:56.103Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("heartbeat | take 10"), - // DisplayName: to.Ptr("Heartbeat_2"), - // ID: to.Ptr("bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:26.794Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:26.794Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("heartbeat | take 10"), - // DisplayName: to.Ptr("Heartbeat_3"), - // ID: to.Ptr("8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:29.450Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:29.450Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("a5a9010e-e4b7-45ad-8b14-09d7e6082819"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a5a9010e-e4b7-45ad-8b14-09d7e6082819"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("heartbeat | take 10"), - // DisplayName: to.Ptr("Heartbeat_4"), - // ID: to.Ptr("a5a9010e-e4b7-45ad-8b14-09d7e6082819"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesSearch.json -func ExampleQueriesClient_NewSearchPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueriesClient().NewSearchPager("my-resource-group", "my-querypack", armoperationalinsights.LogAnalyticsQueryPackQuerySearchProperties{ - Related: &armoperationalinsights.LogAnalyticsQueryPackQuerySearchPropertiesRelated{ - Categories: []*string{ - to.Ptr("other"), - to.Ptr("analytics")}, - }, - Tags: map[string][]*string{ - "my-label": { - to.Ptr("label1")}, - }, - }, &armoperationalinsights.QueriesClientSearchOptions{Top: to.Ptr[int64](3), - IncludeBody: to.Ptr(true), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogAnalyticsQueryPackQueryListResult = armoperationalinsights.LogAnalyticsQueryPackQueryListResult{ - // Value: []*armoperationalinsights.LogAnalyticsQueryPackQuery{ - // { - // Name: to.Ptr("4337bb16-d6fe-4ff7-97cf-59df25941476"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/4337bb16-d6fe-4ff7-97cf-59df25941476"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat 0"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("Heartbeat | take 1"), - // DisplayName: to.Ptr("Heartbeat_1"), - // ID: to.Ptr("4337bb16-d6fe-4ff7-97cf-59df25941476"), - // Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - // Categories: []*string{ - // to.Ptr("other")}, - // }, - // Tags: map[string][]*string{ - // "my-label": []*string{ - // to.Ptr("label1")}, - // "my-other-label": []*string{ - // to.Ptr("label2")}, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:29:56.103Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:29:56.103Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat 1"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("Heartbeat | take 1"), - // DisplayName: to.Ptr("Heartbeat_2"), - // ID: to.Ptr("bf015bf7-be70-49c2-8d52-4cce85c42ef1"), - // Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - // Categories: []*string{ - // to.Ptr("analytics")}, - // }, - // Tags: map[string][]*string{ - // "my-label": []*string{ - // to.Ptr("label1")}, - // "my-other-label": []*string{ - // to.Ptr("label2")}, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:26.794Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:26.794Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query takes 10 entries of heartbeat 2"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("Heartbeat | take 1"), - // DisplayName: to.Ptr("Heartbeat_3"), - // ID: to.Ptr("8d91c6ca-9c56-49c6-b3ae-112a68871acd"), - // Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - // Categories: []*string{ - // to.Ptr("other"), - // to.Ptr("analytics")}, - // }, - // Tags: map[string][]*string{ - // "my-label": []*string{ - // to.Ptr("label1")}, - // "my-other-label": []*string{ - // to.Ptr("label2")}, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:29.450Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:29.450Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesGet.json -func ExampleQueriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueriesClient().Get(ctx, "my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPackQuery = armoperationalinsights.LogAnalyticsQueryPackQuery{ - // Name: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("Thie query fetcges the recent exceptions from the last 24 hours"), - // Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - // DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), - // ID: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-12T11:44:39.298Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-14T13:13:19.338Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesPut.json -func ExampleQueriesClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueriesClient().Put(ctx, "my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", armoperationalinsights.LogAnalyticsQueryPackQuery{ - Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - Description: to.Ptr("my description"), - Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), - Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - Categories: []*string{ - to.Ptr("analytics")}, - }, - Tags: map[string][]*string{ - "my-label": { - to.Ptr("label1")}, - "my-other-label": { - to.Ptr("label2")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPackQuery = armoperationalinsights.LogAnalyticsQueryPackQuery{ - // Name: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("my description"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - // DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), - // ID: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - // Categories: []*string{ - // to.Ptr("analytics")}, - // }, - // Tags: map[string][]*string{ - // "my-label": []*string{ - // to.Ptr("label1")}, - // "my-other-label": []*string{ - // to.Ptr("label2")}, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesUpdate.json -func ExampleQueriesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueriesClient().Update(ctx, "my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", armoperationalinsights.LogAnalyticsQueryPackQuery{ - Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - Description: to.Ptr("my description"), - Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), - Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - Categories: []*string{ - to.Ptr("analytics")}, - }, - Tags: map[string][]*string{ - "my-label": { - to.Ptr("label1")}, - "my-other-label": { - to.Ptr("label2")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPackQuery = armoperationalinsights.LogAnalyticsQueryPackQuery{ - // Name: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // Type: to.Ptr("microsoft.operationalinsights/queryPacks/queries"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack/queries/a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // SystemData: &armoperationalinsights.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T01:01:01.107Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T02:03:01.197Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armoperationalinsights.IdentityTypeApplication), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ - // Description: to.Ptr("my description"), - // Author: to.Ptr("1809f206-263a-46f7-942d-4572c156b7e7"), - // Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - // DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), - // ID: to.Ptr("a449f8af-8e64-4b3a-9b16-5a7165ff98c4"), - // Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ - // Categories: []*string{ - // to.Ptr("analytics")}, - // }, - // Tags: map[string][]*string{ - // "my-label": []*string{ - // to.Ptr("label1")}, - // "my-other-label": []*string{ - // to.Ptr("label2")}, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-15T10:30:32.574Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesDelete.json -func ExampleQueriesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueriesClient().Delete(ctx, "my-resource-group", "my-querypack", "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go index faa38059a945..9ff296f63361 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewQueryPacksClient(subscriptionID string, credential azcore.TokenCredentia // nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - logAnalyticsQueryPackPayload - Properties that need to be specified to create or update a Log Analytics QueryPack. @@ -76,7 +73,7 @@ func (client *QueryPacksClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *QueryPacksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, options *QueryPacksClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *QueryPacksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, _ *QueryPacksClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -95,7 +92,7 @@ func (client *QueryPacksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, logAnalyticsQueryPackPayload); err != nil { @@ -117,7 +114,7 @@ func (client *QueryPacksClient) createOrUpdateHandleResponse(resp *http.Response // nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - logAnalyticsQueryPackPayload - Properties that need to be specified to create or update a Log Analytics QueryPack. // - options - QueryPacksClientCreateOrUpdateWithoutNameOptions contains the optional parameters for the QueryPacksClient.CreateOrUpdateWithoutName @@ -145,7 +142,7 @@ func (client *QueryPacksClient) CreateOrUpdateWithoutName(ctx context.Context, r } // createOrUpdateWithoutNameCreateRequest creates the CreateOrUpdateWithoutName request. -func (client *QueryPacksClient) createOrUpdateWithoutNameCreateRequest(ctx context.Context, resourceGroupName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, options *QueryPacksClientCreateOrUpdateWithoutNameOptions) (*policy.Request, error) { +func (client *QueryPacksClient) createOrUpdateWithoutNameCreateRequest(ctx context.Context, resourceGroupName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, _ *QueryPacksClientCreateOrUpdateWithoutNameOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -160,7 +157,7 @@ func (client *QueryPacksClient) createOrUpdateWithoutNameCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, logAnalyticsQueryPackPayload); err != nil { @@ -181,7 +178,7 @@ func (client *QueryPacksClient) createOrUpdateWithoutNameHandleResponse(resp *ht // Delete - Deletes a Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - options - QueryPacksClientDeleteOptions contains the optional parameters for the QueryPacksClient.Delete method. @@ -207,7 +204,7 @@ func (client *QueryPacksClient) Delete(ctx context.Context, resourceGroupName st } // deleteCreateRequest creates the Delete request. -func (client *QueryPacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientDeleteOptions) (*policy.Request, error) { +func (client *QueryPacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, _ *QueryPacksClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -226,7 +223,7 @@ func (client *QueryPacksClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +232,7 @@ func (client *QueryPacksClient) deleteCreateRequest(ctx context.Context, resourc // Get - Returns a Log Analytics QueryPack. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - options - QueryPacksClientGetOptions contains the optional parameters for the QueryPacksClient.Get method. @@ -262,7 +259,7 @@ func (client *QueryPacksClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *QueryPacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientGetOptions) (*policy.Request, error) { +func (client *QueryPacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, _ *QueryPacksClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -281,7 +278,7 @@ func (client *QueryPacksClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +295,7 @@ func (client *QueryPacksClient) getHandleResponse(resp *http.Response) (QueryPac // NewListPager - Gets a list of all Log Analytics QueryPacks within a subscription. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - options - QueryPacksClientListOptions contains the optional parameters for the QueryPacksClient.NewListPager method. func (client *QueryPacksClient) NewListPager(options *QueryPacksClientListOptions) *runtime.Pager[QueryPacksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[QueryPacksClientListResponse]{ @@ -324,7 +321,7 @@ func (client *QueryPacksClient) NewListPager(options *QueryPacksClientListOption } // listCreateRequest creates the List request. -func (client *QueryPacksClient) listCreateRequest(ctx context.Context, options *QueryPacksClientListOptions) (*policy.Request, error) { +func (client *QueryPacksClient) listCreateRequest(ctx context.Context, _ *QueryPacksClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/queryPacks" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -335,7 +332,7 @@ func (client *QueryPacksClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +349,7 @@ func (client *QueryPacksClient) listHandleResponse(resp *http.Response) (QueryPa // NewListByResourceGroupPager - Gets a list of Log Analytics QueryPacks within a resource group. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - QueryPacksClientListByResourceGroupOptions contains the optional parameters for the QueryPacksClient.NewListByResourceGroupPager // method. @@ -380,7 +377,7 @@ func (client *QueryPacksClient) NewListByResourceGroupPager(resourceGroupName st } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *QueryPacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *QueryPacksClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *QueryPacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *QueryPacksClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -395,7 +392,7 @@ func (client *QueryPacksClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,7 +410,7 @@ func (client *QueryPacksClient) listByResourceGroupHandleResponse(resp *http.Res // UpdateTags - Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2019-09-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - queryPackName - The name of the Log Analytics QueryPack resource. // - queryPackTags - Updated tag information to set into the QueryPack instance. @@ -441,7 +438,7 @@ func (client *QueryPacksClient) UpdateTags(ctx context.Context, resourceGroupNam } // updateTagsCreateRequest creates the UpdateTags request. -func (client *QueryPacksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, queryPackTags TagsResource, options *QueryPacksClientUpdateTagsOptions) (*policy.Request, error) { +func (client *QueryPacksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, queryPackTags TagsResource, _ *QueryPacksClientUpdateTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -460,7 +457,7 @@ func (client *QueryPacksClient) updateTagsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2019-09-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, queryPackTags); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client_example_test.go deleted file mode 100644 index ba1dd6f7762a..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/querypacks_client_example_test.go +++ /dev/null @@ -1,344 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksList.json -func ExampleQueryPacksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueryPacksClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogAnalyticsQueryPackListResult = armoperationalinsights.LogAnalyticsQueryPackListResult{ - // Value: []*armoperationalinsights.LogAnalyticsQueryPack{ - // { - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("d1c8fc00-2b68-441e-8f9b-ded8748dc6aa"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("my-other-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-other-resource-group/providers/microsoft.operationalinsights/queryPacks/my-other-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("aac8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksListByResourceGroup.json -func ExampleQueryPacksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueryPacksClient().NewListByResourceGroupPager("my-resource-group", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LogAnalyticsQueryPackListResult = armoperationalinsights.LogAnalyticsQueryPackListResult{ - // Value: []*armoperationalinsights.LogAnalyticsQueryPack{ - // { - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("d1c8fc00-2b68-441e-8f9b-ded8748dc6aa"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("my-other-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-other-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("aac8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksCreateNoName.json -func ExampleQueryPacksClient_CreateOrUpdateWithoutName_queryPackCreateNoName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueryPacksClient().CreateOrUpdateWithoutName(ctx, "my-resource-group", armoperationalinsights.LogAnalyticsQueryPack{ - Location: to.Ptr("South Central US"), - Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackUpdateNoName.json -func ExampleQueryPacksClient_CreateOrUpdateWithoutName_queryPackUpdateNoName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueryPacksClient().CreateOrUpdateWithoutName(ctx, "my-resource-group", armoperationalinsights.LogAnalyticsQueryPack{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksDelete.json -func ExampleQueryPacksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueryPacksClient().Delete(ctx, "my-resource-group", "my-querypack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksGet.json -func ExampleQueryPacksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryPacksClient().Get(ctx, "my-resource-group", "my-querypack", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPack = armoperationalinsights.LogAnalyticsQueryPack{ - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("southcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("d1c8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksCreate.json -func ExampleQueryPacksClient_CreateOrUpdate_queryPackCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryPacksClient().CreateOrUpdate(ctx, "my-resource-group", "my-querypack", armoperationalinsights.LogAnalyticsQueryPack{ - Location: to.Ptr("South Central US"), - Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPack = armoperationalinsights.LogAnalyticsQueryPack{ - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("d1c8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksUpdate.json -func ExampleQueryPacksClient_CreateOrUpdate_queryPackUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryPacksClient().CreateOrUpdate(ctx, "my-resource-group", "my-querypack", armoperationalinsights.LogAnalyticsQueryPack{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPack = armoperationalinsights.LogAnalyticsQueryPack{ - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4919/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("aac8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksUpdateTagsOnly.json -func ExampleQueryPacksClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryPacksClient().UpdateTags(ctx, "my-resource-group", "my-querypack", armoperationalinsights.TagsResource{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - "Tag2": to.Ptr("Value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsQueryPack = armoperationalinsights.LogAnalyticsQueryPack{ - // Name: to.Ptr("my-querypack"), - // Type: to.Ptr("microsoft.operationalinsights/querypacks"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/microsoft.operationalinsights/queryPacks/my-querypack"), - // Location: to.Ptr("South Central US"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // "Tag2": to.Ptr("Value2"), - // }, - // Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // QueryPackID: to.Ptr("aac8fc00-2b68-441e-8f9b-ded8748dc635"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-04T12:37:56.854Z"); return t}()), - // TimeModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-04T12:37:56.854Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/responses.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/responses.go index 11e0c295ceec..01b2fbcc7542 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/responses.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/responses.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -333,6 +330,11 @@ type StorageInsightConfigsClientListByWorkspaceResponse struct { StorageInsightListResult } +// TablesClientCancelSearchResponse contains the response from method TablesClient.CancelSearch. +type TablesClientCancelSearchResponse struct { + // placeholder for future response values +} + // TablesClientCreateOrUpdateResponse contains the response from method TablesClient.BeginCreateOrUpdate. type TablesClientCreateOrUpdateResponse struct { // Workspace data table definition. @@ -399,6 +401,12 @@ type WorkspacesClientDeleteResponse struct { // placeholder for future response values } +// WorkspacesClientGetNSPResponse contains the response from method WorkspacesClient.GetNSP. +type WorkspacesClientGetNSPResponse struct { + // Network security perimeter (NSP) configuration resource + NetworkSecurityPerimeterConfiguration +} + // WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get. type WorkspacesClientGetResponse struct { // The top level Workspace resource container. @@ -411,12 +419,23 @@ type WorkspacesClientListByResourceGroupResponse struct { WorkspaceListResult } +// WorkspacesClientListNSPResponse contains the response from method WorkspacesClient.NewListNSPPager. +type WorkspacesClientListNSPResponse struct { + // Result of a list NSP (network security perimeter) configurations request. + NetworkSecurityPerimeterConfigurationListResult +} + // WorkspacesClientListResponse contains the response from method WorkspacesClient.NewListPager. type WorkspacesClientListResponse struct { // The list workspaces operation response. WorkspaceListResult } +// WorkspacesClientReconcileNSPResponse contains the response from method WorkspacesClient.BeginReconcileNSP. +type WorkspacesClientReconcileNSPResponse struct { + // placeholder for future response values +} + // WorkspacesClientUpdateResponse contains the response from method WorkspacesClient.Update. type WorkspacesClientUpdateResponse struct { // The top level Workspace resource container. diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go index cb66ee145bbe..f02c3291011d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewSavedSearchesClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates a saved search for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - savedSearchID - The id of the saved search. @@ -76,7 +73,7 @@ func (client *SavedSearchesClient) CreateOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SavedSearchesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters SavedSearch, options *SavedSearchesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SavedSearchesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters SavedSearch, _ *SavedSearchesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -99,7 +96,7 @@ func (client *SavedSearchesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +117,7 @@ func (client *SavedSearchesClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes the specified saved search in a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - savedSearchID - The id of the saved search. @@ -147,7 +144,7 @@ func (client *SavedSearchesClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *SavedSearchesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, options *SavedSearchesClientDeleteOptions) (*policy.Request, error) { +func (client *SavedSearchesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, _ *SavedSearchesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -170,7 +167,7 @@ func (client *SavedSearchesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -178,7 +175,7 @@ func (client *SavedSearchesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the specified saved search for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - savedSearchID - The id of the saved search. @@ -206,7 +203,7 @@ func (client *SavedSearchesClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *SavedSearchesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, options *SavedSearchesClientGetOptions) (*policy.Request, error) { +func (client *SavedSearchesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, _ *SavedSearchesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -229,7 +226,7 @@ func (client *SavedSearchesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +244,7 @@ func (client *SavedSearchesClient) getHandleResponse(resp *http.Response) (Saved // ListByWorkspace - Gets the saved searches for a given Log Analytics Workspace // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - SavedSearchesClientListByWorkspaceOptions contains the optional parameters for the SavedSearchesClient.ListByWorkspace @@ -275,7 +272,7 @@ func (client *SavedSearchesClient) ListByWorkspace(ctx context.Context, resource } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *SavedSearchesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SavedSearchesClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *SavedSearchesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *SavedSearchesClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -294,7 +291,7 @@ func (client *SavedSearchesClient) listByWorkspaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client_example_test.go deleted file mode 100644 index 9c2e10e453f5..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/savedsearches_client_example_test.go +++ /dev/null @@ -1,136 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDeleteSavedSearches.json -func ExampleSavedSearchesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSavedSearchesClient().Delete(ctx, "TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json -func ExampleSavedSearchesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSavedSearchesClient().CreateOrUpdate(ctx, "TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", armoperationalinsights.SavedSearch{ - Properties: &armoperationalinsights.SavedSearchProperties{ - Category: to.Ptr("Saved Search Test Category"), - DisplayName: to.Ptr("Create or Update Saved Search Test"), - FunctionAlias: to.Ptr("heartbeat_func"), - FunctionParameters: to.Ptr("a:int=1"), - Query: to.Ptr("Heartbeat | summarize Count() by Computer | take a"), - Tags: []*armoperationalinsights.Tag{ - { - Name: to.Ptr("Group"), - Value: to.Ptr("Computer"), - }}, - Version: to.Ptr[int64](2), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SavedSearch = armoperationalinsights.SavedSearch{ - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/AtlantisDemo/savedSearches/test-new-saved-search-id-2015"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A15%3A41.0709875Z'\""), - // Properties: &armoperationalinsights.SavedSearchProperties{ - // Category: to.Ptr("Saved Search Test Category"), - // DisplayName: to.Ptr("Create or Update Saved Search Test"), - // FunctionAlias: to.Ptr("heartbeat_func"), - // FunctionParameters: to.Ptr("a:int=1"), - // Query: to.Ptr("Heartbeat | summarize Count() by Computer | take a"), - // Version: to.Ptr[int64](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesGet.json -func ExampleSavedSearchesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSavedSearchesClient().Get(ctx, "TestRG", "TestWS", "00000000-0000-0000-0000-00000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SavedSearch = armoperationalinsights.SavedSearch{ - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/AtlantisDemo/savedSearches/test-new-saved-search-id-2015"), - // Etag: to.Ptr("W/\"datetime'2017-10-02T23%3A15%3A41.0709875Z'\""), - // Properties: &armoperationalinsights.SavedSearchProperties{ - // Category: to.Ptr(" Saved Search Test Category"), - // DisplayName: to.Ptr("Create or Update Saved Search Test"), - // FunctionAlias: to.Ptr("heartbeat_func"), - // FunctionParameters: to.Ptr("a:int=1"), - // Query: to.Ptr("* | measure Count() by Computer | take a"), - // Version: to.Ptr[int64](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesListByWorkspace.json -func ExampleSavedSearchesClient_ListByWorkspace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSavedSearchesClient().ListByWorkspace(ctx, "TestRG", "TestWS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SavedSearchesListResult = armoperationalinsights.SavedSearchesListResult{ - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go index a3f117e06092..be197659b83c 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewSchemaClient(subscriptionID string, credential azcore.TokenCredential, o // Get - Gets the schema for a given workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - SchemaClientGetOptions contains the optional parameters for the SchemaClient.Get method. @@ -73,7 +70,7 @@ func (client *SchemaClient) Get(ctx context.Context, resourceGroupName string, w } // getCreateRequest creates the Get request. -func (client *SchemaClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SchemaClientGetOptions) (*policy.Request, error) { +func (client *SchemaClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *SchemaClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -92,7 +89,7 @@ func (client *SchemaClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client_example_test.go deleted file mode 100644 index 7b4080d839d7..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/schema_client_example_test.go +++ /dev/null @@ -1,84 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesGetSchema.json -func ExampleSchemaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSchemaClient().Get(ctx, "mms-eus", "atlantisdemo", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SearchGetSchemaResponse = armoperationalinsights.SearchGetSchemaResponse{ - // Metadata: &armoperationalinsights.SearchMetadata{ - // Schema: &armoperationalinsights.SearchMetadataSchema{ - // Name: to.Ptr("CloudOps"), - // Version: to.Ptr[int32](2), - // }, - // RequestTime: to.Ptr[int64](28), - // ResultType: to.Ptr("schema"), - // }, - // Value: []*armoperationalinsights.SearchSchemaValue{ - // { - // Name: to.Ptr("TenantId"), - // Type: to.Ptr("Guid"), - // DisplayName: to.Ptr("TenantId"), - // Facet: to.Ptr(false), - // Indexed: to.Ptr(true), - // OwnerType: []*string{ - // to.Ptr("Alert"), - // to.Ptr("AzureActivity"), - // to.Ptr("AzureAudit"), - // to.Ptr("AzureMetrics"), - // to.Ptr("ComputerGroup"), - // to.Ptr("ETWEvent"), - // to.Ptr("Event"), - // to.Ptr("ExtraHopDBLogin"), - // to.Ptr("ExtraHopDBTransaction"), - // to.Ptr("ExtraHopDNSResponse"), - // to.Ptr("ExtraHopFTPResponse"), - // to.Ptr("ExtraHopHTTPTransaction"), - // to.Ptr("ExtraHopSMTPMessage"), - // to.Ptr("ExtraHopSYNScanDetect"), - // to.Ptr("ExtraHopTCPOpen"), - // to.Ptr("Heartbeat"), - // to.Ptr("Operation"), - // to.Ptr("Perf"), - // to.Ptr("ReservedAzureCommonFields"), - // to.Ptr("ReservedCommonFields"), - // to.Ptr("ServiceFabricOperationalEvent"), - // to.Ptr("ServiceFabricReliableActorEvent"), - // to.Ptr("ServiceFabricReliableServiceEvent"), - // to.Ptr("Syslog"), - // to.Ptr("Usage"), - // to.Ptr("W3CIISLog")}, - // Stored: to.Ptr(false), - // }}, - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go index 7df3e6ec9449..f0e6ed224e87 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewSharedKeysClient(subscriptionID string, credential azcore.TokenCredentia // GetSharedKeys - Gets the shared keys for a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - SharedKeysClientGetSharedKeysOptions contains the optional parameters for the SharedKeysClient.GetSharedKeys @@ -74,7 +71,7 @@ func (client *SharedKeysClient) GetSharedKeys(ctx context.Context, resourceGroup } // getSharedKeysCreateRequest creates the GetSharedKeys request. -func (client *SharedKeysClient) getSharedKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SharedKeysClientGetSharedKeysOptions) (*policy.Request, error) { +func (client *SharedKeysClient) getSharedKeysCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *SharedKeysClientGetSharedKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -93,7 +90,7 @@ func (client *SharedKeysClient) getSharedKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +109,7 @@ func (client *SharedKeysClient) getSharedKeysHandleResponse(resp *http.Response) // Insights agents to the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - SharedKeysClientRegenerateOptions contains the optional parameters for the SharedKeysClient.Regenerate method. @@ -139,7 +136,7 @@ func (client *SharedKeysClient) Regenerate(ctx context.Context, resourceGroupNam } // regenerateCreateRequest creates the Regenerate request. -func (client *SharedKeysClient) regenerateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SharedKeysClientRegenerateOptions) (*policy.Request, error) { +func (client *SharedKeysClient) regenerateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *SharedKeysClientRegenerateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -158,7 +155,7 @@ func (client *SharedKeysClient) regenerateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client_example_test.go deleted file mode 100644 index 2c84e0b118a1..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/sharedkeys_client_example_test.go +++ /dev/null @@ -1,66 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGetSharedKeys.json -func ExampleSharedKeysClient_GetSharedKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedKeysClient().GetSharedKeys(ctx, "rg1", "TestLinkWS", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedKeys = armoperationalinsights.SharedKeys{ - // PrimarySharedKey: to.Ptr(""), - // SecondarySharedKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesRegenerateSharedKeys.json -func ExampleSharedKeysClient_Regenerate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedKeysClient().Regenerate(ctx, "rg1", "workspace1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedKeys = armoperationalinsights.SharedKeys{ - // PrimarySharedKey: to.Ptr(""), - // SecondarySharedKey: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go index 4d4b414c6e9a..e37fc31a551e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewStorageInsightConfigsClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Create or update a storage insight. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - storageInsightName - Name of the storageInsightsConfigs resource @@ -76,7 +73,7 @@ func (client *StorageInsightConfigsClient) CreateOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *StorageInsightConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight, options *StorageInsightConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *StorageInsightConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight, _ *StorageInsightConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -99,7 +96,7 @@ func (client *StorageInsightConfigsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +117,7 @@ func (client *StorageInsightConfigsClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes a storageInsightsConfigs resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - storageInsightName - Name of the storageInsightsConfigs resource @@ -148,7 +145,7 @@ func (client *StorageInsightConfigsClient) Delete(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *StorageInsightConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, options *StorageInsightConfigsClientDeleteOptions) (*policy.Request, error) { +func (client *StorageInsightConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, _ *StorageInsightConfigsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -171,7 +168,7 @@ func (client *StorageInsightConfigsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -179,7 +176,7 @@ func (client *StorageInsightConfigsClient) deleteCreateRequest(ctx context.Conte // Get - Gets a storage insight instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - storageInsightName - Name of the storageInsightsConfigs resource @@ -208,7 +205,7 @@ func (client *StorageInsightConfigsClient) Get(ctx context.Context, resourceGrou } // getCreateRequest creates the Get request. -func (client *StorageInsightConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, options *StorageInsightConfigsClientGetOptions) (*policy.Request, error) { +func (client *StorageInsightConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, _ *StorageInsightConfigsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -231,7 +228,7 @@ func (client *StorageInsightConfigsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +245,7 @@ func (client *StorageInsightConfigsClient) getHandleResponse(resp *http.Response // NewListByWorkspacePager - Lists the storage insight instances within a workspace // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - StorageInsightConfigsClientListByWorkspaceOptions contains the optional parameters for the StorageInsightConfigsClient.NewListByWorkspacePager @@ -277,7 +274,7 @@ func (client *StorageInsightConfigsClient) NewListByWorkspacePager(resourceGroup } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *StorageInsightConfigsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *StorageInsightConfigsClientListByWorkspaceOptions) (*policy.Request, error) { +func (client *StorageInsightConfigsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *StorageInsightConfigsClientListByWorkspaceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -296,7 +293,7 @@ func (client *StorageInsightConfigsClient) listByWorkspaceCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client_example_test.go deleted file mode 100644 index 517466cee483..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/storageinsightconfigs_client_example_test.go +++ /dev/null @@ -1,153 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsCreateOrUpdate.json -func ExampleStorageInsightConfigsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageInsightConfigsClient().CreateOrUpdate(ctx, "OIAutoRest5123", "aztest5048", "AzTestSI1110", armoperationalinsights.StorageInsight{ - Properties: &armoperationalinsights.StorageInsightProperties{ - Containers: []*string{ - to.Ptr("wad-iis-logfiles")}, - StorageAccount: &armoperationalinsights.StorageAccount{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/OIAutoRest6987/providers/microsoft.storage/storageaccounts/AzTestFakeSA9945"), - Key: to.Ptr("1234"), - }, - Tables: []*string{ - to.Ptr("WADWindowsEventLogsTable"), - to.Ptr("LinuxSyslogVer2v0")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageInsight = armoperationalinsights.StorageInsight{ - // Name: to.Ptr("AzTestSI1110"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/storageinsightconfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6987/providers/microsoft.operationalinsights/workspaces/aztest5048/storageinsightconfigs/AzTestSI1110"), - // Properties: &armoperationalinsights.StorageInsightProperties{ - // Containers: []*string{ - // to.Ptr("wad-iis-logfiles")}, - // Status: &armoperationalinsights.StorageInsightStatus{ - // State: to.Ptr(armoperationalinsights.StorageInsightStateOK), - // }, - // StorageAccount: &armoperationalinsights.StorageAccount{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/OIAutoRest6987/providers/microsoft.storage/storageaccounts/AzTestFakeSA9945"), - // Key: to.Ptr("Storage Key"), - // }, - // Tables: []*string{ - // to.Ptr("WADWindowsEventLogsTable"), - // to.Ptr("LinuxSyslogVer2v0")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsGet.json -func ExampleStorageInsightConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageInsightConfigsClient().Get(ctx, "OIAutoRest5123", "aztest5048", "AzTestSI1110", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageInsight = armoperationalinsights.StorageInsight{ - // Name: to.Ptr("AzTestSI1110"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces/storageinsightconfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6987/providers/microsoft.operationalinsights/workspaces/aztest5048/storageinsightconfigs/AzTestSI1110"), - // Properties: &armoperationalinsights.StorageInsightProperties{ - // Containers: []*string{ - // to.Ptr("wad-iis-logfiles")}, - // Status: &armoperationalinsights.StorageInsightStatus{ - // State: to.Ptr(armoperationalinsights.StorageInsightStateOK), - // }, - // StorageAccount: &armoperationalinsights.StorageAccount{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/OIAutoRest6987/providers/microsoft.storage/storageaccounts/AzTestFakeSA9945"), - // Key: to.Ptr("Storage Account Key"), - // }, - // Tables: []*string{ - // to.Ptr("WADWindowsEventLogsTable"), - // to.Ptr("LinuxSyslogVer2v0")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsDelete.json -func ExampleStorageInsightConfigsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewStorageInsightConfigsClient().Delete(ctx, "OIAutoRest5123", "aztest5048", "AzTestSI1110", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsListByWorkspace.json -func ExampleStorageInsightConfigsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageInsightConfigsClient().NewListByWorkspacePager("OIAutoRest5123", "aztest5048", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageInsightListResult = armoperationalinsights.StorageInsightListResult{ - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go index a0e518996093..fd123de97c61 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -43,10 +40,69 @@ func NewTablesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } +// CancelSearch - Cancel a log analytics workspace search results table query run. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - The name of the workspace. +// - tableName - The name of the table. +// - options - TablesClientCancelSearchOptions contains the optional parameters for the TablesClient.CancelSearch method. +func (client *TablesClient) CancelSearch(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientCancelSearchOptions) (TablesClientCancelSearchResponse, error) { + var err error + const operationName = "TablesClient.CancelSearch" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelSearchCreateRequest(ctx, resourceGroupName, workspaceName, tableName, options) + if err != nil { + return TablesClientCancelSearchResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return TablesClientCancelSearchResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TablesClientCancelSearchResponse{}, err + } + return TablesClientCancelSearchResponse{}, nil +} + +// cancelSearchCreateRequest creates the CancelSearch request. +func (client *TablesClient) cancelSearchCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, _ *TablesClientCancelSearchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/cancelSearch" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if tableName == "" { + return nil, errors.New("parameter tableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginCreateOrUpdate - Update or Create a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - tableName - The name of the table. @@ -74,7 +130,7 @@ func (client *TablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Update or Create a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 func (client *TablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TablesClient.BeginCreateOrUpdate" @@ -97,8 +153,8 @@ func (client *TablesClient) createOrUpdate(ctx context.Context, resourceGroupNam } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *TablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" +func (client *TablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, _ *TablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -120,7 +176,7 @@ func (client *TablesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +188,7 @@ func (client *TablesClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - tableName - The name of the table. @@ -158,7 +214,7 @@ func (client *TablesClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 func (client *TablesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TablesClient.BeginDelete" @@ -181,8 +237,8 @@ func (client *TablesClient) deleteOperation(ctx context.Context, resourceGroupNa } // deleteCreateRequest creates the Delete request. -func (client *TablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" +func (client *TablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, _ *TablesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -204,7 +260,7 @@ func (client *TablesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +269,7 @@ func (client *TablesClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - tableName - The name of the table. @@ -241,8 +297,8 @@ func (client *TablesClient) Get(ctx context.Context, resourceGroupName string, w } // getCreateRequest creates the Get request. -func (client *TablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" +func (client *TablesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, _ *TablesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -264,7 +320,7 @@ func (client *TablesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +337,7 @@ func (client *TablesClient) getHandleResponse(resp *http.Response) (TablesClient // NewListByWorkspacePager - Gets all the tables for the specified Log Analytics workspace. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - TablesClientListByWorkspaceOptions contains the optional parameters for the TablesClient.NewListByWorkspacePager @@ -311,8 +367,8 @@ func (client *TablesClient) NewListByWorkspacePager(resourceGroupName string, wo } // listByWorkspaceCreateRequest creates the ListByWorkspace request. -func (client *TablesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *TablesClientListByWorkspaceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables" +func (client *TablesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *TablesClientListByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -330,7 +386,7 @@ func (client *TablesClient) listByWorkspaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +405,7 @@ func (client *TablesClient) listByWorkspaceHandleResponse(resp *http.Response) ( // Data Collection Rule-based Custom Logs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - tableName - The name of the table. @@ -376,8 +432,8 @@ func (client *TablesClient) Migrate(ctx context.Context, resourceGroupName strin } // migrateCreateRequest creates the Migrate request. -func (client *TablesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientMigrateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate" +func (client *TablesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, _ *TablesClientMigrateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -399,7 +455,7 @@ func (client *TablesClient) migrateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,7 +464,7 @@ func (client *TablesClient) migrateCreateRequest(ctx context.Context, resourceGr // BeginUpdate - Update a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - tableName - The name of the table. @@ -435,7 +491,7 @@ func (client *TablesClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Update a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 func (client *TablesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "TablesClient.BeginUpdate" @@ -458,8 +514,8 @@ func (client *TablesClient) update(ctx context.Context, resourceGroupName string } // updateCreateRequest creates the Update request. -func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" +func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, _ *TablesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -481,7 +537,7 @@ func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client_example_test.go deleted file mode 100644 index 0e904d31f168..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/tables_client_example_test.go +++ /dev/null @@ -1,495 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesList.json -func ExampleTablesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTablesClient().NewListByWorkspacePager("oiautorest6685", "oiautorest6685", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TablesListResult = armoperationalinsights.TablesListResult{ - // Value: []*armoperationalinsights.Table{ - // { - // Name: to.Ptr("AzureNetworkFlow"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow"), - // Properties: &armoperationalinsights.TableProperties{ - // Schema: &armoperationalinsights.Schema{ - // Name: to.Ptr("AzureNetworkFlow"), - // Solutions: []*string{ - // to.Ptr("LogManagement")}, - // StandardColumns: []*armoperationalinsights.Column{ - // { - // Name: to.Ptr("TenantId"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(true), - // }, - // { - // Name: to.Ptr("SourceSystem"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TimeGenerated"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumDateTime), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AgentID"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SourceIP"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Protocol"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SourcePort"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DestinationPort"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TcpFlags"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Packets"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Bytes"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("BytesOut"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DurationInMs"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("RstCount"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("MaxSampleRtt"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }}, - // TableSubType: to.Ptr(armoperationalinsights.TableSubTypeEnumAny), - // TableType: to.Ptr(armoperationalinsights.TableTypeEnumMicrosoft), - // }, - // ArchiveRetentionInDays: to.Ptr[int32](25), - // Plan: to.Ptr(armoperationalinsights.TablePlanEnumAnalytics), - // ProvisioningState: to.Ptr(armoperationalinsights.ProvisioningStateEnumSucceeded), - // RetentionInDays: to.Ptr[int32](45), - // TotalRetentionInDays: to.Ptr[int32](70), - // }, - // }, - // { - // Name: to.Ptr("SurfaceHubDns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/SurfaceHubDns"), - // Properties: &armoperationalinsights.TableProperties{ - // Schema: &armoperationalinsights.Schema{ - // Name: to.Ptr("SurfaceHubDns"), - // Solutions: []*string{ - // to.Ptr("LogManagement")}, - // StandardColumns: []*armoperationalinsights.Column{ - // { - // Name: to.Ptr("TenantId"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(true), - // }, - // { - // Name: to.Ptr("SourceSystem"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TimeGenerated"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumDateTime), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("QueryName"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ComputerName"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }}, - // TableSubType: to.Ptr(armoperationalinsights.TableSubTypeEnumAny), - // TableType: to.Ptr(armoperationalinsights.TableTypeEnumMicrosoft), - // }, - // ArchiveRetentionInDays: to.Ptr[int32](0), - // Plan: to.Ptr(armoperationalinsights.TablePlanEnumAnalytics), - // ProvisioningState: to.Ptr(armoperationalinsights.ProvisioningStateEnumSucceeded), - // RetentionInDays: to.Ptr[int32](30), - // TotalRetentionInDays: to.Ptr[int32](30), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesUpsert.json -func ExampleTablesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTablesClient().BeginCreateOrUpdate(ctx, "oiautorest6685", "oiautorest6685", "AzureNetworkFlow", armoperationalinsights.Table{ - Properties: &armoperationalinsights.TableProperties{ - Schema: &armoperationalinsights.Schema{ - Name: to.Ptr("AzureNetworkFlow"), - Columns: []*armoperationalinsights.Column{ - { - Name: to.Ptr("MyNewColumn"), - Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - }}, - }, - RetentionInDays: to.Ptr[int32](45), - TotalRetentionInDays: to.Ptr[int32](70), - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Table = armoperationalinsights.Table{ - // Name: to.Ptr("AzureNetworkFlow"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourcegroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/AzureNetworkFlow"), - // Properties: &armoperationalinsights.TableProperties{ - // Schema: &armoperationalinsights.Schema{ - // Name: to.Ptr("AzureNetworkFlow"), - // Columns: []*armoperationalinsights.Column{ - // { - // Name: to.Ptr("MyNewColumn"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }}, - // Solutions: []*string{ - // to.Ptr("LogManagement")}, - // StandardColumns: []*armoperationalinsights.Column{ - // { - // Name: to.Ptr("TenantId"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(true), - // }, - // { - // Name: to.Ptr("SourceSystem"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TimeGenerated"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumDateTime), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("AgentID"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SourceIP"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Protocol"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SourcePort"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DestinationPort"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TcpFlags"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Packets"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Bytes"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("BytesOut"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("DurationInMs"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("RstCount"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("MaxSampleRtt"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumInt), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }}, - // TableSubType: to.Ptr(armoperationalinsights.TableSubTypeEnumDataCollectionRuleBased), - // TableType: to.Ptr(armoperationalinsights.TableTypeEnumMicrosoft), - // }, - // ArchiveRetentionInDays: to.Ptr[int32](25), - // Plan: to.Ptr(armoperationalinsights.TablePlanEnumAnalytics), - // ProvisioningState: to.Ptr(armoperationalinsights.ProvisioningStateEnumSucceeded), - // RetentionInDays: to.Ptr[int32](45), - // TotalRetentionInDays: to.Ptr[int32](70), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesGet.json -func ExampleTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTablesClient().Get(ctx, "oiautorest6685", "oiautorest6685", "table1_SRCH", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Table = armoperationalinsights.Table{ - // Name: to.Ptr("table1_SRCH"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/oiautorest6685/providers/Microsoft.OperationalInsights/workspaces/oiautorest6685/tables/table1_SRCH"), - // Properties: &armoperationalinsights.TableProperties{ - // Schema: &armoperationalinsights.Schema{ - // Name: to.Ptr("table1_SRCH"), - // Columns: []*armoperationalinsights.Column{ - // }, - // SearchResults: &armoperationalinsights.SearchResults{ - // Description: to.Ptr("This table was created using a Search Job with the following query: 'Heartbeat | where SourceSystem != '' | project SourceSystem'."), - // EndSearchTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T04:05:06.000Z"); return t}()), - // Limit: to.Ptr[int32](1000), - // Query: to.Ptr("Heartbeat | where SourceSystem != '' | project SourceSystem"), - // SourceTable: to.Ptr("Heartbeat"), - // StartSearchTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T04:05:06.000Z"); return t}()), - // }, - // Solutions: []*string{ - // to.Ptr("LogManagement")}, - // StandardColumns: []*armoperationalinsights.Column{ - // { - // Name: to.Ptr("TenantId"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("SourceSystem"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("MG"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("ManagementGroupName"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("TimeGenerated"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumDateTime), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Computer"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }, - // { - // Name: to.Ptr("RawData"), - // Type: to.Ptr(armoperationalinsights.ColumnTypeEnumString), - // IsDefaultDisplay: to.Ptr(false), - // IsHidden: to.Ptr(false), - // }}, - // TableSubType: to.Ptr(armoperationalinsights.TableSubTypeEnumDataCollectionRuleBased), - // TableType: to.Ptr(armoperationalinsights.TableTypeEnumSearchResults), - // }, - // ArchiveRetentionInDays: to.Ptr[int32](0), - // Plan: to.Ptr(armoperationalinsights.TablePlanEnumAnalytics), - // ProvisioningState: to.Ptr(armoperationalinsights.ProvisioningStateEnumSucceeded), - // ResultStatistics: &armoperationalinsights.ResultStatistics{ - // IngestedRecords: to.Ptr[int32](5), - // Progress: to.Ptr[float32](75), - // }, - // RetentionInDays: to.Ptr[int32](50), - // TotalRetentionInDays: to.Ptr[int32](50), - // }, - // SystemData: &armoperationalinsights.SystemDataAutoGenerated{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-03T04:05:06.000Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-00000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesDelete.json -func ExampleTablesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTablesClient().BeginDelete(ctx, "oiautorest6685", "oiautorest6685", "table1_CL", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesMigrate.json -func ExampleTablesClient_Migrate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTablesClient().Migrate(ctx, "oiautorest6685", "oiautorest6685", "table1_CL", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go index 7bf9f575bbc2..9b5f2fe92f2d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go index b3c6ab1f18b7..a4c952d037b5 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - Gets a list of usage metrics for a workspace. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. @@ -74,7 +71,7 @@ func (client *UsagesClient) NewListPager(resourceGroupName string, workspaceName } // listCreateRequest creates the List request. -func (client *UsagesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *UsagesClientListOptions) (*policy.Request, error) { +func (client *UsagesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *UsagesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -93,7 +90,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client_example_test.go deleted file mode 100644 index bdb97088fdff..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/usages_client_example_test.go +++ /dev/null @@ -1,57 +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. -// DO NOT EDIT. - -package armoperationalinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListUsages.json -func ExampleUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("rg1", "TestLinkWS", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListUsagesResult = armoperationalinsights.WorkspaceListUsagesResult{ - // Value: []*armoperationalinsights.UsageMetric{ - // { - // Name: &armoperationalinsights.MetricName{ - // LocalizedValue: to.Ptr("Data Analyzed"), - // Value: to.Ptr("DataAnalyzed"), - // }, - // CurrentValue: to.Ptr[float64](0), - // Limit: to.Ptr[float64](524288000), - // NextResetTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-03T00:00:00.000Z"); return t}()), - // QuotaPeriod: to.Ptr("P1D"), - // Unit: to.Ptr("Bytes"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go index e9c7337958b8..29aade94d1f6 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewWorkspacePurgeClient(subscriptionID string, credential azcore.TokenCrede // GetPurgeStatus - Gets status of an ongoing purge operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - purgeID - In a purge status request, this is the Id of the operation the status of which is returned. @@ -75,7 +72,7 @@ func (client *WorkspacePurgeClient) GetPurgeStatus(ctx context.Context, resource } // getPurgeStatusCreateRequest creates the GetPurgeStatus request. -func (client *WorkspacePurgeClient) getPurgeStatusCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, purgeID string, options *WorkspacePurgeClientGetPurgeStatusOptions) (*policy.Request, error) { +func (client *WorkspacePurgeClient) getPurgeStatusCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, purgeID string, _ *WorkspacePurgeClientGetPurgeStatusOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,7 +95,7 @@ func (client *WorkspacePurgeClient) getPurgeStatusCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +120,7 @@ func (client *WorkspacePurgeClient) getPurgeStatusHandleResponse(resp *http.Resp // GDPR compliance. In the event of a dispute, please create a support ticket // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-08-01 +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - body - Describes the body of a request to purge data in a single table of an Log Analytics Workspace @@ -151,7 +148,7 @@ func (client *WorkspacePurgeClient) Purge(ctx context.Context, resourceGroupName } // purgeCreateRequest creates the Purge request. -func (client *WorkspacePurgeClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody, options *WorkspacePurgeClientPurgeOptions) (*policy.Request, error) { +func (client *WorkspacePurgeClient) purgeCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody, _ *WorkspacePurgeClientPurgeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -170,7 +167,7 @@ func (client *WorkspacePurgeClient) purgeCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client_example_test.go deleted file mode 100644 index 12e7f600757d..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspacepurge_client_example_test.go +++ /dev/null @@ -1,92 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json -func ExampleWorkspacePurgeClient_Purge_workspacePurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacePurgeClient().Purge(ctx, "OIAutoRest5123", "aztest5048", armoperationalinsights.WorkspacePurgeBody{ - Filters: []*armoperationalinsights.WorkspacePurgeBodyFilters{ - { - Column: to.Ptr("TimeGenerated"), - Operator: to.Ptr(">"), - Value: "2017-09-01T00:00:00", - }}, - Table: to.Ptr("Heartbeat"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json -func ExampleWorkspacePurgeClient_Purge_workspacePurgeResourceId() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacePurgeClient().Purge(ctx, "OIAutoRest5123", "aztest5048", armoperationalinsights.WorkspacePurgeBody{ - Filters: []*armoperationalinsights.WorkspacePurgeBodyFilters{ - { - Column: to.Ptr("_ResourceId"), - Operator: to.Ptr("=="), - Value: "/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/SomeResourceGroup/providers/microsoft.insights/components/AppInsightResource", - }}, - Table: to.Ptr("Heartbeat"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeOperation.json -func ExampleWorkspacePurgeClient_GetPurgeStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacePurgeClient().GetPurgeStatus(ctx, "OIAutoRest5123", "aztest5048", "purge-970318e7-b859-4edb-8903-83b1b54d0b74", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspacePurgeStatusResponse = armoperationalinsights.WorkspacePurgeStatusResponse{ - // Status: to.Ptr(armoperationalinsights.PurgeStateCompleted), - // } -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go index 571445653fbe..b3559a0f59a1 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - parameters - The parameters required to create or update a workspace. @@ -73,7 +70,7 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "WorkspacesClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, _ *WorkspacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -115,7 +112,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +126,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, // another workspace. To remove the workspace completely and release the name, use the force flag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. @@ -155,7 +152,7 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa // another workspace. To remove the workspace completely and release the name, use the force flag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "WorkspacesClient.BeginDelete" @@ -197,7 +194,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -209,7 +206,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a workspace instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -236,7 +233,7 @@ func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (*policy.Request, error) { +func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *WorkspacesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -255,7 +252,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,9 +267,78 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac return result, nil } +// GetNSP - Gets a network security perimeter configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - The name of the workspace. +// - networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration +// - options - WorkspacesClientGetNSPOptions contains the optional parameters for the WorkspacesClient.GetNSP method. +func (client *WorkspacesClient) GetNSP(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, options *WorkspacesClientGetNSPOptions) (WorkspacesClientGetNSPResponse, error) { + var err error + const operationName = "WorkspacesClient.GetNSP" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getNSPCreateRequest(ctx, resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return WorkspacesClientGetNSPResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return WorkspacesClientGetNSPResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientGetNSPResponse{}, err + } + resp, err := client.getNSPHandleResponse(httpResp) + return resp, err +} + +// getNSPCreateRequest creates the GetNSP request. +func (client *WorkspacesClient) getNSPCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, _ *WorkspacesClientGetNSPOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getNSPHandleResponse handles the GetNSP response. +func (client *WorkspacesClient) getNSPHandleResponse(resp *http.Response) (WorkspacesClientGetNSPResponse, error) { + result := WorkspacesClientGetNSPResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return WorkspacesClientGetNSPResponse{}, err + } + return result, nil +} + // NewListPager - Gets the workspaces in a subscription. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - options - WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method. func (client *WorkspacesClient) NewListPager(options *WorkspacesClientListOptions) *runtime.Pager[WorkspacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WorkspacesClientListResponse]{ @@ -299,7 +365,7 @@ func (client *WorkspacesClient) NewListPager(options *WorkspacesClientListOption } // listCreateRequest creates the List request. -func (client *WorkspacesClient) listCreateRequest(ctx context.Context, options *WorkspacesClientListOptions) (*policy.Request, error) { +func (client *WorkspacesClient) listCreateRequest(ctx context.Context, _ *WorkspacesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -310,7 +376,7 @@ func (client *WorkspacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +393,7 @@ func (client *WorkspacesClient) listHandleResponse(resp *http.Response) (Workspa // NewListByResourceGroupPager - Gets workspaces in a resource group. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager // method. @@ -356,7 +422,7 @@ func (client *WorkspacesClient) NewListByResourceGroupPager(resourceGroupName st } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WorkspacesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *WorkspacesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -371,7 +437,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,10 +452,156 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res return result, nil } +// NewListNSPPager - Gets a list of NSP configurations for specified workspace. +// +// Generated from API version 2025-02-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - The name of the workspace. +// - options - WorkspacesClientListNSPOptions contains the optional parameters for the WorkspacesClient.NewListNSPPager method. +func (client *WorkspacesClient) NewListNSPPager(resourceGroupName string, workspaceName string, options *WorkspacesClientListNSPOptions) *runtime.Pager[WorkspacesClientListNSPResponse] { + return runtime.NewPager(runtime.PagingHandler[WorkspacesClientListNSPResponse]{ + More: func(page WorkspacesClientListNSPResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *WorkspacesClientListNSPResponse) (WorkspacesClientListNSPResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "WorkspacesClient.NewListNSPPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listNSPCreateRequest(ctx, resourceGroupName, workspaceName, options) + }, nil) + if err != nil { + return WorkspacesClientListNSPResponse{}, err + } + return client.listNSPHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listNSPCreateRequest creates the ListNSP request. +func (client *WorkspacesClient) listNSPCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, _ *WorkspacesClientListNSPOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listNSPHandleResponse handles the ListNSP response. +func (client *WorkspacesClient) listNSPHandleResponse(resp *http.Response) (WorkspacesClientListNSPResponse, error) { + result := WorkspacesClientListNSPResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationListResult); err != nil { + return WorkspacesClientListNSPResponse{}, err + } + return result, nil +} + +// BeginReconcileNSP - Reconcile network security perimeter configuration for Workspace resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - workspaceName - The name of the workspace. +// - networkSecurityPerimeterConfigurationName - The name for a network security perimeter configuration +// - options - WorkspacesClientBeginReconcileNSPOptions contains the optional parameters for the WorkspacesClient.BeginReconcileNSP +// method. +func (client *WorkspacesClient) BeginReconcileNSP(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, options *WorkspacesClientBeginReconcileNSPOptions) (*runtime.Poller[WorkspacesClientReconcileNSPResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reconcileNSP(ctx, resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[WorkspacesClientReconcileNSPResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[WorkspacesClientReconcileNSPResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ReconcileNSP - Reconcile network security perimeter configuration for Workspace resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-01 +func (client *WorkspacesClient) reconcileNSP(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, options *WorkspacesClientBeginReconcileNSPOptions) (*http.Response, error) { + var err error + const operationName = "WorkspacesClient.BeginReconcileNSP" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileNSPCreateRequest(ctx, resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// reconcileNSPCreateRequest creates the ReconcileNSP request. +func (client *WorkspacesClient) reconcileNSPCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, networkSecurityPerimeterConfigurationName string, _ *WorkspacesClientBeginReconcileNSPOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if networkSecurityPerimeterConfigurationName == "" { + return nil, errors.New("parameter networkSecurityPerimeterConfigurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkSecurityPerimeterConfigurationName}", url.PathEscape(networkSecurityPerimeterConfigurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Update - Updates a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-12-01-preview +// Generated from API version 2025-02-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - workspaceName - The name of the workspace. // - parameters - The parameters required to patch a workspace. @@ -417,7 +629,7 @@ func (client *WorkspacesClient) Update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspacePatch, options *WorkspacesClientUpdateOptions) (*policy.Request, error) { +func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspacePatch, _ *WorkspacesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -436,7 +648,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01-preview") + reqQP.Set("api-version", "2025-02-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client_example_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client_example_test.go deleted file mode 100644 index 26c2b65e0c71..000000000000 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/workspaces_client_example_test.go +++ /dev/null @@ -1,259 +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. -// DO NOT EDIT. - -package armoperationalinsights_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/operationalinsights/armoperationalinsights/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesSubscriptionList.json -func ExampleWorkspacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armoperationalinsights.WorkspaceListResult{ - // Value: []*armoperationalinsights.Workspace{ - // { - // Name: to.Ptr("AzTest2170"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // CustomerID: to.Ptr("bc089d7b-485c-4aff-a71e-c00f362d8d2f"), - // ProvisioningState: to.Ptr(armoperationalinsights.WorkspaceEntityStatusSucceeded), - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesListByResourceGroup.json -func ExampleWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("oiautorest6685", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceListResult = armoperationalinsights.WorkspaceListResult{ - // Value: []*armoperationalinsights.Workspace{ - // { - // Name: to.Ptr("AzTest2170"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // CustomerID: to.Ptr("bc089d7b-485c-4aff-a71e-c00f362d8d2f"), - // ProvisioningState: to.Ptr(armoperationalinsights.WorkspaceEntityStatusSucceeded), - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesCreate.json -func ExampleWorkspacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "oiautorest6685", "oiautorest6685", armoperationalinsights.Workspace{ - Location: to.Ptr("australiasoutheast"), - Tags: map[string]*string{ - "tag1": to.Ptr("val1"), - }, - Properties: &armoperationalinsights.WorkspaceProperties{ - RetentionInDays: to.Ptr[int32](30), - SKU: &armoperationalinsights.WorkspaceSKU{ - Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - }, - }, - }, 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armoperationalinsights.Workspace{ - // Name: to.Ptr("AzTest2170"), - // Type: to.Ptr("Microsoft.OperationalInsights/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000005/resourcegroups/oiautorest6685/providers/microsoft.operationalinsights/workspaces/aztest2170"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // CustomerID: to.Ptr("bc089d7b-485c-4aff-a71e-c00f362d8d2f"), - // ProvisioningState: to.Ptr(armoperationalinsights.WorkspaceEntityStatusSucceeded), - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesDelete.json -func ExampleWorkspacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginDelete(ctx, "oiautorest6685", "oiautorest6685", &armoperationalinsights.WorkspacesClientBeginDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesGet.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "oiautorest6685", "oiautorest6685", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armoperationalinsights.Workspace{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4ce13e8353a25125a41bc01705c0a7794dac32a7/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesUpdate.json -func ExampleWorkspacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armoperationalinsights.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Update(ctx, "oiautorest6685", "oiautorest6685", armoperationalinsights.WorkspacePatch{ - Properties: &armoperationalinsights.WorkspaceProperties{ - RetentionInDays: to.Ptr[int32](30), - SKU: &armoperationalinsights.WorkspaceSKU{ - Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - }, - WorkspaceCapping: &armoperationalinsights.WorkspaceCapping{ - DailyQuotaGb: to.Ptr[float64](-1), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Workspace = armoperationalinsights.Workspace{ - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("val1"), - // }, - // Properties: &armoperationalinsights.WorkspaceProperties{ - // PublicNetworkAccessForIngestion: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // PublicNetworkAccessForQuery: to.Ptr(armoperationalinsights.PublicNetworkAccessTypeEnabled), - // RetentionInDays: to.Ptr[int32](30), - // SKU: &armoperationalinsights.WorkspaceSKU{ - // Name: to.Ptr(armoperationalinsights.WorkspaceSKUNameEnumPerGB2018), - // }, - // WorkspaceCapping: &armoperationalinsights.WorkspaceCapping{ - // DailyQuotaGb: to.Ptr[float64](-1), - // DataIngestionStatus: to.Ptr(armoperationalinsights.DataIngestionStatusRespectQuota), - // QuotaNextResetTime: to.Ptr("Mon, 16 Nov 2020 15:00:00 GMT"), - // }, - // }, - // } -}