// 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) Go Code Generator. DO NOT EDIT.

package armeventhub_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub/v2"
	"log"
)

// Generated from example definition: 2025-05-01-preview/NameSpaces/NetworkSecurityPerimeterConfigurationReconcile.json
func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginCreateOrUpdate() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeventhub.NewClientFactory("subID", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().BeginCreateOrUpdate(ctx, "SDK-EventHub-4794", "sdk-Namespace-5828", "resourceAssociation1", 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 poll 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 = armeventhub.NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse{
	// }
}

// Generated from example definition: 2025-05-01-preview/NameSpaces/NetworkSecurityPerimeterConfigurationAssociationproxy.json
func ExampleNetworkSecurityPerimeterConfigurationsClient_GetResourceAssociationName() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armeventhub.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().GetResourceAssociationName(ctx, "SDK-EventHub-4794", "sdk-Namespace-5828", "resourceAssociation1", 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 = armeventhub.NetworkSecurityPerimeterConfigurationsClientGetResourceAssociationNameResponse{
	// 	NetworkSecurityPerimeterConfiguration: armeventhub.NetworkSecurityPerimeterConfiguration{
	// 		Name: to.Ptr("resourceAssociation1"),
	// 		Type: to.Ptr("Microsoft.EventHub/Namespaces/networkSecurityPerimeterConfigurations"),
	// 		ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-EventHub-4794/providers/Microsoft.EventHub/namespaces/sdk-Namespace-5705-new/networkSecurityPerimeterConfigurations/resourceAssociation1"),
	// 		Properties: &armeventhub.NetworkSecurityPerimeterConfigurationProperties{
	// 			NetworkSecurityPerimeter: &armeventhub.NetworkSecurityPerimeter{
	// 				ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SDK-EventHub-4794/providers/Microsoft.Network/networkSecurityPerimeters/nsp1"),
	// 				Location: to.Ptr("East US"),
	// 				PerimeterGUID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 			},
	// 			Profile: &armeventhub.NetworkSecurityPerimeterConfigurationPropertiesProfile{
	// 				Name: to.Ptr("devProfile"),
	// 				AccessRules: []*armeventhub.NspAccessRule{
	// 					{
	// 						Name: to.Ptr("inVpnRule"),
	// 						Properties: &armeventhub.NspAccessRuleProperties{
	// 							AddressPrefixes: []*string{
	// 								to.Ptr("148.0.0.0/8"),
	// 								to.Ptr("152.4.6.0/24"),
	// 							},
	// 							Direction: to.Ptr(armeventhub.NspAccessRuleDirectionInbound),
	// 						},
	// 					},
	// 				},
	// 				AccessRulesVersion: to.Ptr("10"),
	// 			},
	// 			ProvisioningState: to.Ptr(armeventhub.NetworkSecurityPerimeterConfigurationProvisioningStateUpdating),
	// 			ResourceAssociation: &armeventhub.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation{
	// 				Name: to.Ptr("association1"),
	// 				AccessMode: to.Ptr(armeventhub.ResourceAssociationAccessModeEnforcedMode),
	// 			},
	// 		},
	// 	},
	// }
}
