From 9c0cddfd62d53b6de55634781a4e63e6630dcbbc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 27 Nov 2023 05:16:51 +0000 Subject: [PATCH] CodeGen from PR 26785 in Azure/azure-rest-api-specs Merge c745095aa9c2545feaf912bd98846a1a7b9f43bb into 739f4f5d1a66adc8c556e17e2ab4360aeaf546e7 --- .../armnetworkanalytics/CHANGELOG.md | 4 + .../armnetworkanalytics/autorest.md | 7 +- .../armnetworkanalytics/constants.go | 2 +- .../dataproducts_client_example_test.go | 1115 ----------------- ...ataproductscatalogs_client_example_test.go | 266 ---- .../datatypes_client_example_test.go | 464 ------- .../armnetworkanalytics/go.mod | 12 +- .../armnetworkanalytics/go.sum | 19 - .../operations_client_example_test.go | 85 -- 9 files changed, 9 insertions(+), 1965 deletions(-) delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go delete mode 100644 sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md index 72a6099fae49..1f983baa8543 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0 (2023-11-27) +### Other Changes + + ## 0.1.0 (2023-11-24) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md index 3236e070ec37..c2c2193fa6d5 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkanalytics/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkanalytics/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2023-11-15 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go index f682f9e50043..23529a788159 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/constants.go @@ -10,7 +10,7 @@ package armnetworkanalytics const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go deleted file mode 100644 index 5eec44e83e05..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproducts_client_example_test.go +++ /dev/null @@ -1,1115 +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 armnetworkanalytics_test - -import ( - "context" - "log" - - "time" - - "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/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MaximumSet_Gen.json -func ExampleDataProductsClient_NewListBySubscriptionPager_dataProductsListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListBySubscriptionPager(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.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListBySubscription_MinimumSet_Gen.json -func ExampleDataProductsClient_NewListBySubscriptionPager_dataProductsListBySubscriptionMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListBySubscriptionPager(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.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDataProductsClient_NewListByResourceGroupPager_dataProductsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListByResourceGroupPager("aoiresourceGroupName", 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.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListByResourceGroup_MinimumSet_Gen.json -func ExampleDataProductsClient_NewListByResourceGroupPager_dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsClient().NewListByResourceGroupPager("aoiresourceGroupName", 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.DataProductListResult = armnetworkanalytics.DataProductListResult{ - // Value: []*armnetworkanalytics.DataProduct{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MaximumSet_Gen.json -func ExampleDataProductsClient_Get_dataProductsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", 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.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Get_MinimumSet_Gen.json -func ExampleDataProductsClient_Get_dataProductsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", 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.DataProduct = armnetworkanalytics.DataProduct{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginCreate_dataProductsCreateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProduct{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - Identity: &armnetworkanalytics.ManagedServiceIdentity{ - Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetworkanalytics.DataProductProperties{ - ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{}, - CurrentMinorVersion: to.Ptr("1.0.1"), - CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - KeyName: to.Ptr("keyName"), - KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - KeyVersion: to.Ptr("keyVersion"), - }, - CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - MajorVersion: to.Ptr("1.0.0"), - ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - Name: to.Ptr("managedResourceGroupName"), - Location: to.Ptr("eastus"), - }, - Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - AllowedQueryIPRangeList: []*string{ - to.Ptr("1.1.1.1")}, - DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - IPRules: []*armnetworkanalytics.IPRules{ - { - Action: to.Ptr("Allow"), - Value: to.Ptr("1.1.1.1"), - }}, - VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - { - Action: to.Ptr("Allow"), - ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - State: to.Ptr(""), - }}, - }, - Owners: []*string{ - to.Ptr("abc@micros.com")}, - PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - Product: to.Ptr("MCC"), - ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - Publisher: to.Ptr("Microsoft"), - PurviewAccount: to.Ptr("testpurview"), - PurviewCollection: to.Ptr("134567890"), - Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - }, - }, 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.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Create_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginCreate_dataProductsCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProduct{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - Properties: &armnetworkanalytics.DataProductProperties{ - MajorVersion: to.Ptr("1.0.0"), - Product: to.Ptr("MCC"), - Publisher: to.Ptr("Microsoft"), - }, - }, 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.DataProduct = armnetworkanalytics.DataProduct{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // Location: to.Ptr("eastus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginUpdate_dataProductsUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProductUpdate{ - Identity: &armnetworkanalytics.ManagedServiceIdentity{ - Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Properties: &armnetworkanalytics.DataProductUpdateProperties{ - CurrentMinorVersion: to.Ptr("1.0.1"), - Owners: []*string{ - to.Ptr("abc@micros.com"), - to.Ptr("def@micros.com")}, - PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - PurviewAccount: to.Ptr("testpurview"), - PurviewCollection: to.Ptr("134567890"), - }, - Tags: map[string]*string{ - "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - }, - }, 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.DataProduct = armnetworkanalytics.DataProduct{ - // Name: to.Ptr("dataproduct01"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/DataProducts/dataproduct01"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "userSpecifiedKeyName": to.Ptr("userSpecifiedKeyValue"), - // }, - // Identity: &armnetworkanalytics.ManagedServiceIdentity{ - // Type: to.Ptr(armnetworkanalytics.ManagedServiceIdentityType("IdentityType")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armnetworkanalytics.UserAssignedIdentity{ - // "key8474": &armnetworkanalytics.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armnetworkanalytics.DataProductProperties{ - // AvailableMinorVersions: []*string{ - // to.Ptr("1.0.1"), - // to.Ptr("1.0.2")}, - // ConsumptionEndpoints: &armnetworkanalytics.ConsumptionEndpointsProperties{ - // FileAccessResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // FileAccessURL: to.Ptr("https://operatorinsightsstorageResourceName.blob.core.windows.net"), - // IngestionResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageResourceName"), - // IngestionURL: to.Ptr("https://aoiingestionstorageResourceName.blob.core.windows.net"), - // QueryResourceID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Kusto/clusters/clusterName"), - // QueryURL: to.Ptr("https://opinsightsclusterName.regionName.kusto.windows.net"), - // }, - // CurrentMinorVersion: to.Ptr("1.0.1"), - // CustomerEncryptionKey: &armnetworkanalytics.EncryptionKeyDetails{ - // KeyName: to.Ptr("keyName"), - // KeyVaultURI: to.Ptr("https://KeyVault.vault.azure.net"), - // KeyVersion: to.Ptr("keyVersion"), - // }, - // CustomerManagedKeyEncryptionEnabled: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Documentation: to.Ptr("https://learn.microsoft.com/"), - // KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - // MajorVersion: to.Ptr("1.0.0"), - // ManagedResourceGroupConfiguration: &armnetworkanalytics.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // Networkacls: &armnetworkanalytics.DataProductNetworkACLs{ - // AllowedQueryIPRangeList: []*string{ - // to.Ptr("1.1.1.1"), - // to.Ptr("1.1.1.2")}, - // DefaultAction: to.Ptr(armnetworkanalytics.DefaultActionAllow), - // IPRules: []*armnetworkanalytics.IPRules{ - // { - // Action: to.Ptr("Allow"), - // Value: to.Ptr("1.1.1.1"), - // }}, - // VirtualNetworkRule: []*armnetworkanalytics.VirtualNetworkRule{ - // { - // Action: to.Ptr("Allow"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName"), - // State: to.Ptr("Succeeded"), - // }}, - // }, - // Owners: []*string{ - // to.Ptr("abc@micros.com"), - // to.Ptr("def@micros.com")}, - // PrivateLinksEnabled: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // Product: to.Ptr("MCC"), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armnetworkanalytics.ControlStateEnabled), - // Publisher: to.Ptr("Microsoft"), - // PurviewAccount: to.Ptr("testpurview"), - // PurviewCollection: to.Ptr("134567890"), - // Redundancy: to.Ptr(armnetworkanalytics.ControlStateDisabled), - // ResourceGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Update_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginUpdate_dataProductsUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.DataProductUpdate{}, 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.DataProduct = armnetworkanalytics.DataProduct{ - // Location: to.Ptr("jwlerdaudgxff"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MaximumSet_Gen.json -func ExampleDataProductsClient_BeginDelete_dataProductsDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_Delete_MinimumSet_Gen.json -func ExampleDataProductsClient_BeginDelete_dataProductsDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataProductsClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MaximumSet_Gen.json -func ExampleDataProductsClient_AddUserRole_dataProductsAddUserRoleMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().AddUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentCommonProperties{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, 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.RoleAssignmentDetail = armnetworkanalytics.RoleAssignmentDetail{ - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_AddUserRole_MinimumSet_Gen.json -func ExampleDataProductsClient_AddUserRole_dataProductsAddUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().AddUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentCommonProperties{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("userName"), - }, 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.RoleAssignmentDetail = armnetworkanalytics.RoleAssignmentDetail{ - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("userName"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen.json -func ExampleDataProductsClient_GenerateStorageAccountSasToken_dataProductsGenerateStorageAccountSasTokenMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().GenerateStorageAccountSasToken(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.AccountSas{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.151Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.151Z"); return t }()), - }, 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.AccountSasToken = armnetworkanalytics.AccountSasToken{ - // StorageAccountSasToken: to.Ptr("storageAccountSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_GenerateStorageAccountSasToken_MinimumSet_Gen.json -func ExampleDataProductsClient_GenerateStorageAccountSasToken_dataProductsGenerateStorageAccountSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().GenerateStorageAccountSasToken(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.AccountSas{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:17.051Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:17.051Z"); return t }()), - }, 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.AccountSasToken = armnetworkanalytics.AccountSasToken{ - // StorageAccountSasToken: to.Ptr("storageAccountSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MaximumSet_Gen.json -func ExampleDataProductsClient_ListRolesAssignments_dataProductsListRolesAssignmentsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().ListRolesAssignments(ctx, "aoiresourceGroupName", "dataproduct01", map[string]any{}, 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.ListRoleAssignments = armnetworkanalytics.ListRoleAssignments{ - // Count: to.Ptr[int32](1), - // RoleAssignmentResponse: []*armnetworkanalytics.RoleAssignmentDetail{ - // { - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_ListRolesAssignments_MinimumSet_Gen.json -func ExampleDataProductsClient_ListRolesAssignments_dataProductsListRolesAssignmentsMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsClient().ListRolesAssignments(ctx, "aoiresourceGroupName", "dataproduct01", map[string]any{}, 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.ListRoleAssignments = armnetworkanalytics.ListRoleAssignments{ - // Count: to.Ptr[int32](1), - // RoleAssignmentResponse: []*armnetworkanalytics.RoleAssignmentDetail{ - // { - // DataTypeScope: []*string{ - // to.Ptr("scope")}, - // PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // PrincipalType: to.Ptr("User"), - // Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - // RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - // UserName: to.Ptr("UserName"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MaximumSet_Gen.json -func ExampleDataProductsClient_RemoveUserRole_dataProductsRemoveUserRoleMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RemoveUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentDetail{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RemoveUserRole_MinimumSet_Gen.json -func ExampleDataProductsClient_RemoveUserRole_dataProductsRemoveUserRoleMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RemoveUserRole(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.RoleAssignmentDetail{ - DataTypeScope: []*string{ - to.Ptr("scope")}, - PrincipalID: to.Ptr("00000000-0000-0000-0000-00000000000"), - PrincipalType: to.Ptr("User"), - Role: to.Ptr(armnetworkanalytics.DataProductUserRoleReader), - RoleAssignmentID: to.Ptr("00000000-0000-0000-0000-00000000000"), - RoleID: to.Ptr("00000000-0000-0000-0000-00000000000"), - UserName: to.Ptr("UserName"), - }, 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MaximumSet_Gen.json -func ExampleDataProductsClient_RotateKey_dataProductsRotateKeyMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RotateKey(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.KeyVaultInfo{ - KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - }, 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProducts_RotateKey_MinimumSet_Gen.json -func ExampleDataProductsClient_RotateKey_dataProductsRotateKeyMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDataProductsClient().RotateKey(ctx, "aoiresourceGroupName", "dataproduct01", armnetworkanalytics.KeyVaultInfo{ - KeyVaultURL: to.Ptr("https://myKeyVault.vault.azure.net"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go deleted file mode 100644 index e30eb3235cf9..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/dataproductscatalogs_client_example_test.go +++ /dev/null @@ -1,266 +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 armnetworkanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListBySubscriptionPager_dataProductsCatalogsListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListBySubscriptionPager(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.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListBySubscription_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListBySubscriptionPager_dataProductsCatalogsListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListBySubscriptionPager(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.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListByResourceGroupPager_dataProductsCatalogsListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListByResourceGroupPager("aoiresourceGroupName", 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.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_ListByResourceGroup_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_NewListByResourceGroupPager_dataProductsCatalogsListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataProductsCatalogsClient().NewListByResourceGroupPager("aoiresourceGroupName", 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.DataProductsCatalogListResult = armnetworkanalytics.DataProductsCatalogListResult{ - // Value: []*armnetworkanalytics.DataProductsCatalog{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MaximumSet_Gen.json -func ExampleDataProductsCatalogsClient_Get_dataProductsCatalogsGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsCatalogsClient().Get(ctx, "aoiresourceGroupName", 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.DataProductsCatalog = armnetworkanalytics.DataProductsCatalog{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/dataProductsCatalogs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataProductsCatalogProperties{ - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // Publishers: []*armnetworkanalytics.PublisherInformation{ - // { - // DataProducts: []*armnetworkanalytics.DataProductInformation{ - // { - // Description: to.Ptr("Official data product for Mobile Content Cloud."), - // DataProductName: to.Ptr("MCC"), - // DataProductVersions: []*armnetworkanalytics.DataProductVersion{ - // { - // Version: to.Ptr("1.0.0"), - // }}, - // }}, - // PublisherName: to.Ptr("Microsoft"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataProductsCatalogs_Get_MinimumSet_Gen.json -func ExampleDataProductsCatalogsClient_Get_dataProductsCatalogsGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataProductsCatalogsClient().Get(ctx, "aoiresourceGroupName", 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.DataProductsCatalog = armnetworkanalytics.DataProductsCatalog{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default"), - // } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go deleted file mode 100644 index 0b37a665ba1f..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/datatypes_client_example_test.go +++ /dev/null @@ -1,464 +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 armnetworkanalytics_test - -import ( - "context" - "log" - - "time" - - "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/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MaximumSet_Gen.json -func ExampleDataTypesClient_NewListByDataProductPager_dataTypesListByDataProductMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataTypesClient().NewListByDataProductPager("aoiresourceGroupName", "dataproduct01", 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.DataTypeListResult = armnetworkanalytics.DataTypeListResult{ - // Value: []*armnetworkanalytics.DataType{ - // { - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("state Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_ListByDataProduct_MinimumSet_Gen.json -func ExampleDataTypesClient_NewListByDataProductPager_dataTypesListByDataProductMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDataTypesClient().NewListByDataProductPager("aoiresourceGroupName", "dataproduct01", 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.DataTypeListResult = armnetworkanalytics.DataTypeListResult{ - // Value: []*armnetworkanalytics.DataType{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MaximumSet_Gen.json -func ExampleDataTypesClient_Get_dataTypesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", 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.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("state Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Get_MinimumSet_Gen.json -func ExampleDataTypesClient_Get_dataTypesGetMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().Get(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", 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.DataType = armnetworkanalytics.DataType{ - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginCreate_dataTypesCreateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataType{ - Properties: &armnetworkanalytics.DataTypeProperties{ - DatabaseCacheRetention: to.Ptr[int32](23), - DatabaseRetention: to.Ptr[int32](6), - ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - StorageOutputRetention: to.Ptr[int32](27), - }, - }, 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.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypeName"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](23), - // DatabaseRetention: to.Ptr[int32](6), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("State Reason"), - // StorageOutputRetention: to.Ptr[int32](27), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Create_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginCreate_dataTypesCreateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginCreate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataType{}, 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.DataType = armnetworkanalytics.DataType{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginUpdate_dataTypesUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataTypeUpdate{ - Properties: &armnetworkanalytics.DataTypeUpdateProperties{ - DatabaseCacheRetention: to.Ptr[int32](16), - DatabaseRetention: to.Ptr[int32](9), - State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - StorageOutputRetention: to.Ptr[int32](30), - }, - }, 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.DataType = armnetworkanalytics.DataType{ - // Name: to.Ptr("datatypename"), - // Type: to.Ptr("Microsoft.NetworkAnalytics/DataProducts/DataTypes"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/aoiresourceGroupName/providers/Microsoft.NetworkAnalytics/dataProducts/dataproduct01/dataTypes/datatypename"), - // SystemData: &armnetworkanalytics.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // CreatedBy: to.Ptr("abc@micros.com"), - // CreatedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-04T08:26:27.150Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@micros.com"), - // LastModifiedByType: to.Ptr(armnetworkanalytics.CreatedByTypeUser), - // }, - // Properties: &armnetworkanalytics.DataTypeProperties{ - // DatabaseCacheRetention: to.Ptr[int32](16), - // DatabaseRetention: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armnetworkanalytics.ProvisioningStateSucceeded), - // State: to.Ptr(armnetworkanalytics.DataTypeState("STARTED")), - // StateReason: to.Ptr("State Reason"), - // StorageOutputRetention: to.Ptr[int32](30), - // VisualizationURL: to.Ptr("visualizationUrl"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Update_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginUpdate_dataTypesUpdateMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginUpdate(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.DataTypeUpdate{}, 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.DataType = armnetworkanalytics.DataType{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginDelete_dataTypesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_Delete_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginDelete_dataTypesDeleteMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDelete(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MaximumSet_Gen.json -func ExampleDataTypesClient_BeginDeleteData_dataTypesDeleteDataMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDeleteData(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", map[string]any{}, 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_DeleteData_MinimumSet_Gen.json -func ExampleDataTypesClient_BeginDeleteData_dataTypesDeleteDataMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDataTypesClient().BeginDeleteData(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", map[string]any{}, 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/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MaximumSet_Gen.json -func ExampleDataTypesClient_GenerateStorageContainerSasToken_dataTypesGenerateStorageContainerSasTokenMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().GenerateStorageContainerSasToken(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.ContainerSaS{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.039Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:34:58.039Z"); return t }()), - }, 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.ContainerSasToken = armnetworkanalytics.ContainerSasToken{ - // StorageContainerSasToken: to.Ptr("storageContainerSasToken"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/DataTypes_GenerateStorageContainerSasToken_MinimumSet_Gen.json -func ExampleDataTypesClient_GenerateStorageContainerSasToken_dataTypesGenerateStorageContainerSasTokenMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDataTypesClient().GenerateStorageContainerSasToken(ctx, "aoiresourceGroupName", "dataproduct01", "datatypename", armnetworkanalytics.ContainerSaS{ - ExpiryTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:16.887Z"); return t }()), - IPAddress: to.Ptr("1.1.1.1"), - StartTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-24T05:35:16.887Z"); return t }()), - }, 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.ContainerSasToken = armnetworkanalytics.ContainerSasToken{ - // StorageContainerSasToken: to.Ptr("storageContainerSasToken"), - // } -} diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod index d2421333b143..0f2f29f4cea7 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/ar go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect ) diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum index 7985f1da436f..428cd71de305 100644 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum +++ b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/go.sum @@ -1,31 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go b/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go deleted file mode 100644 index 4e94f22a37ea..000000000000 --- a/sdk/resourcemanager/networkanalytics/armnetworkanalytics/operations_client_example_test.go +++ /dev/null @@ -1,85 +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 armnetworkanalytics_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkanalytics/armnetworkanalytics" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.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 = armnetworkanalytics.OperationListResult{ - // Value: []*armnetworkanalytics.Operation{ - // { - // Name: to.Ptr("Microsoft.NetworkAnalytics/resourceName/operationName"), - // ActionType: to.Ptr(armnetworkanalytics.ActionTypeInternal), - // Display: &armnetworkanalytics.OperationDisplay{ - // Description: to.Ptr("Description of the operation"), - // Operation: to.Ptr("OperationName"), - // Provider: to.Ptr("Microsoft.NetworkAnalytics"), - // Resource: to.Ptr("ResourceName"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armnetworkanalytics.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/db9788dde7a0c2c0d82e4fdf5f7b4de3843937e3/specification/networkanalytics/resource-manager/Microsoft.NetworkAnalytics/stable/2023-11-15/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkanalytics.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 = armnetworkanalytics.OperationListResult{ - // } - } -}