2021-12-08 06:00:02 +03:00
package armm365securityandcompliance_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/m365securityandcompliance/armm365securityandcompliance"
)
2023-03-31 03:08:11 +03:00
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/m365securityandcompliance/resource-manager/Microsoft.M365SecurityAndCompliance/preview/2021-03-25-preview/examples/EdmUploadServiceDeletePrivateEndpointConnection.json
2021-12-08 06:00:02 +03:00
func ExamplePrivateEndpointConnectionsForEDMClient_BeginDelete ( ) {
cred , err := azidentity . NewDefaultAzureCredential ( nil )
if err != nil {
log . Fatalf ( "failed to obtain a credential: %v" , err )
}
ctx := context . Background ( )
2023-03-31 03:08:11 +03:00
clientFactory , err := armm365securityandcompliance . NewClientFactory ( "<subscription-id>" , cred , nil )
2022-05-06 12:36:15 +03:00
if err != nil {
log . Fatalf ( "failed to create client: %v" , err )
}
2023-03-31 03:08:11 +03:00
poller , err := clientFactory . NewPrivateEndpointConnectionsForEDMClient ( ) . BeginDelete ( ctx , "rgname" , "service1" , "myConnection" , nil )
2021-12-08 06:00:02 +03:00
if err != nil {
2022-05-06 12:36:15 +03:00
log . Fatalf ( "failed to finish the request: %v" , err )
2021-12-08 06:00:02 +03:00
}
2022-05-19 07:33:23 +03:00
_ , err = poller . PollUntilDone ( ctx , nil )
2021-12-08 06:00:02 +03:00
if err != nil {
2022-05-06 12:36:15 +03:00
log . Fatalf ( "failed to pull the result: %v" , err )
2021-12-08 06:00:02 +03:00
}
}