diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md index 42ca23e82eb1..5f87fe40dbd2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.5.1 (2022-05-03) +### Other Changes + + ## 0.5.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md index ce659584ac22..002eb6232d39 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/apimanagement/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/apimanagement/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apimanagement/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.5.0 +module-version: 0.5.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod index 6dd690ebdf3a..419b007a87e2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armap go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum index 56d1c32628ae..a7eaa30576c1 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.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/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -28,26 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go deleted file mode 100644 index 2f6699056de8..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApis.json -func ExampleAPIClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("", - "", - &armapimanagement.APIClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Tags: nil, - ExpandAPIVersionSet: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApi.json -func ExampleAPIClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "", - "", - "", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiContract.json -func ExampleAPIClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApi.json -func ExampleAPIClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armapimanagement.APICreateOrUpdateParameter{ - Properties: &armapimanagement.APICreateOrUpdateProperties{ - Description: to.Ptr(""), - AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ - OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{ - AuthorizationServerID: to.Ptr(""), - Scope: to.Ptr(""), - }, - }, - SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ - Header: to.Ptr("
"), - Query: to.Ptr(""), - }, - Path: to.Ptr(""), - DisplayName: to.Ptr(""), - Protocols: []*armapimanagement.Protocol{ - to.Ptr(armapimanagement.ProtocolHTTPS), - to.Ptr(armapimanagement.ProtocolHTTP)}, - ServiceURL: to.Ptr(""), - }, - }, - &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil, - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.json -func ExampleAPIClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - "", - "", - armapimanagement.APIUpdateContract{ - Properties: &armapimanagement.APIContractUpdateProperties{ - Path: to.Ptr(""), - DisplayName: to.Ptr(""), - ServiceURL: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApi.json -func ExampleAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - "", - &armapimanagement.APIClientDeleteOptions{DeleteRevisions: 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApisByTags.json -func ExampleAPIClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("", - "", - &armapimanagement.APIClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedApis: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go deleted file mode 100644 index b8cfbe8fdf3a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go +++ /dev/null @@ -1,251 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiDiagnostics.json -func ExampleAPIDiagnosticClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("", - "", - "", - &armapimanagement.APIDiagnosticClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiDiagnostic.json -func ExampleAPIDiagnosticClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "", - "", - "", - "", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiDiagnostic.json -func ExampleAPIDiagnosticClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiDiagnostic.json -func ExampleAPIDiagnosticClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - "", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr(""), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - &armapimanagement.APIDiagnosticClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiDiagnostic.json -func ExampleAPIDiagnosticClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - "", - "", - "", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr(""), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiDiagnostic.json -func ExampleAPIDiagnosticClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go deleted file mode 100644 index cea84c4c50ee..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json -func ExampleAPIExportClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIExportClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - armapimanagement.ExportFormatSwagger, - armapimanagement.ExportAPITrue, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go deleted file mode 100644 index d6180c233d70..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssues.json -func ExampleAPIIssueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("", - "", - "", - &armapimanagement.APIIssueClientListByServiceOptions{Filter: nil, - ExpandCommentsAttachments: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssue.json -func ExampleAPIIssueClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "", - "", - "", - "", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssue.json -func ExampleAPIIssueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - "", - &armapimanagement.APIIssueClientGetOptions{ExpandCommentsAttachments: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssue.json -func ExampleAPIIssueClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - "", - armapimanagement.IssueContract{ - Properties: &armapimanagement.IssueContractProperties{ - CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()), - State: to.Ptr(armapimanagement.StateOpen), - Description: to.Ptr(""), - Title: to.Ptr(""), - UserID: to.Ptr("<user-id>"), - }, - }, - &armapimanagement.APIIssueClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiIssue.json -func ExampleAPIIssueClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<if-match>", - armapimanagement.IssueUpdateContract{ - Properties: &armapimanagement.IssueUpdateContractProperties{ - State: to.Ptr(armapimanagement.StateClosed), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssue.json -func ExampleAPIIssueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go deleted file mode 100644 index 5252b04dff20..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueAttachments.json -func ExampleAPIIssueAttachmentClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - &armapimanagement.APIIssueAttachmentClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<attachment-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<attachment-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<attachment-id>", - armapimanagement.IssueAttachmentContract{ - Properties: &armapimanagement.IssueAttachmentContractProperties{ - Content: to.Ptr("<content>"), - ContentFormat: to.Ptr("<content-format>"), - Title: to.Ptr("<title>"), - }, - }, - &armapimanagement.APIIssueAttachmentClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<attachment-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go deleted file mode 100644 index 5011b4a5234f..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueComments.json -func ExampleAPIIssueCommentClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - &armapimanagement.APIIssueCommentClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueComment.json -func ExampleAPIIssueCommentClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<comment-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueComment.json -func ExampleAPIIssueCommentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<comment-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueComment.json -func ExampleAPIIssueCommentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<comment-id>", - armapimanagement.IssueCommentContract{ - Properties: &armapimanagement.IssueCommentContractProperties{ - CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()), - Text: to.Ptr("<text>"), - UserID: to.Ptr("<user-id>"), - }, - }, - &armapimanagement.APIIssueCommentClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueComment.json -func ExampleAPIIssueCommentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<issue-id>", - "<comment-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go deleted file mode 100644 index a18b331112c5..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go +++ /dev/null @@ -1,69 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.json -func ExampleClient_BeginPerformConnectivityCheckAsync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPerformConnectivityCheckAsync(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ConnectivityCheckRequest{ - Destination: &armapimanagement.ConnectivityCheckRequestDestination{ - Address: to.Ptr("<address>"), - Port: to.Ptr[int64](3306), - }, - ProtocolConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfiguration{ - HTTPConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration{ - Method: to.Ptr(armapimanagement.MethodGET), - Headers: []*armapimanagement.HTTPHeader{ - { - Name: to.Ptr("<name>"), - Value: to.Ptr("<value>"), - }}, - ValidStatusCodes: []*int64{ - to.Ptr[int64](200), - to.Ptr[int64](204)}, - }, - }, - Source: &armapimanagement.ConnectivityCheckRequestSource{ - Region: to.Ptr("<region>"), - }, - Protocol: to.Ptr(armapimanagement.ConnectivityCheckProtocolHTTPS), - }, - &armapimanagement.ClientBeginPerformConnectivityCheckAsyncOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go deleted file mode 100644 index f9feb83ec384..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go deleted file mode 100644 index 1ba0024e090b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go +++ /dev/null @@ -1,386 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRestoreWithAccessKey.json -func ExampleServiceClient_BeginRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestore(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ServiceBackupRestoreParameters{ - AccessKey: to.Ptr("<access-key>"), - AccessType: to.Ptr(armapimanagement.AccessTypeAccessKey), - BackupName: to.Ptr("<backup-name>"), - ContainerName: to.Ptr("<container-name>"), - StorageAccount: to.Ptr("<storage-account>"), - }, - &armapimanagement.ServiceClientBeginRestoreOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithAccessKey.json -func ExampleServiceClient_BeginBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBackup(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ServiceBackupRestoreParameters{ - AccessKey: to.Ptr("<access-key>"), - AccessType: to.Ptr(armapimanagement.AccessTypeAccessKey), - BackupName: to.Ptr("<backup-name>"), - ContainerName: to.Ptr("<container-name>"), - StorageAccount: to.Ptr("<storage-account>"), - }, - &armapimanagement.ServiceClientBeginBackupOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json -func ExampleServiceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - "tag3": to.Ptr("value3"), - }, - Location: to.Ptr("<location>"), - Properties: &armapimanagement.ServiceProperties{ - AdditionalLocations: []*armapimanagement.AdditionalLocation{ - { - DisableGateway: to.Ptr(true), - Location: to.Ptr("<location>"), - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypePremium), - Capacity: to.Ptr[int32](1), - }, - }}, - APIVersionConstraint: &armapimanagement.APIVersionConstraint{ - MinAPIVersion: to.Ptr("<min-apiversion>"), - }, - HostnameConfigurations: []*armapimanagement.HostnameConfiguration{ - { - Type: to.Ptr(armapimanagement.HostnameTypeProxy), - CertificatePassword: to.Ptr("<certificate-password>"), - DefaultSSLBinding: to.Ptr(true), - EncodedCertificate: to.Ptr("<encoded-certificate>"), - HostName: to.Ptr("<host-name>"), - }, - { - Type: to.Ptr(armapimanagement.HostnameTypeManagement), - CertificatePassword: to.Ptr("<certificate-password>"), - EncodedCertificate: to.Ptr("<encoded-certificate>"), - HostName: to.Ptr("<host-name>"), - }, - { - Type: to.Ptr(armapimanagement.HostnameTypePortal), - CertificatePassword: to.Ptr("<certificate-password>"), - EncodedCertificate: to.Ptr("<encoded-certificate>"), - HostName: to.Ptr("<host-name>"), - }}, - VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone), - PublisherEmail: to.Ptr("<publisher-email>"), - PublisherName: to.Ptr("<publisher-name>"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypePremium), - Capacity: to.Ptr[int32](1), - }, - }, - &armapimanagement.ServiceClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceDisableTls10.json -func ExampleServiceClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ServiceUpdateParameters{ - Properties: &armapimanagement.ServiceUpdateProperties{ - CustomProperties: map[string]*string{ - "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"), - }, - }, - }, - &armapimanagement.ServiceClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json -func ExampleServiceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceDeleteService.json -func ExampleServiceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "<resource-group-name>", - "<service-name>", - &armapimanagement.ServiceClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json -func ExampleServiceClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("<resource-group-name>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscription.json -func ExampleServiceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetSsoToken.json -func ExampleServiceClient_GetSsoToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSsoToken(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceCheckNameAvailability.json -func ExampleServiceClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armapimanagement.ServiceCheckNameAvailabilityParameters{ - Name: to.Ptr("<name>"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json -func ExampleServiceClient_GetDomainOwnershipIdentifier() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDomainOwnershipIdentifier(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.json -func ExampleServiceClient_BeginApplyNetworkConfigurationUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginApplyNetworkConfigurationUpdates(ctx, - "<resource-group-name>", - "<service-name>", - &armapimanagement.ServiceClientBeginApplyNetworkConfigurationUpdatesOptions{Parameters: &armapimanagement.ServiceApplyNetworkConfigurationParameters{ - Location: to.Ptr("<location>"), - }, - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go deleted file mode 100644 index b6b01f19fd74..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go deleted file mode 100644 index 4144c33f3114..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSku.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSKUsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go deleted file mode 100644 index a861290a7baf..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperation.json -func ExampleAPIOperationClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperation.json -func ExampleAPIOperationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperation.json -func ExampleAPIOperationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - armapimanagement.OperationContract{ - Properties: &armapimanagement.OperationContractProperties{ - Description: to.Ptr("<description>"), - TemplateParameters: []*armapimanagement.ParameterContract{}, - Request: &armapimanagement.RequestContract{ - Description: to.Ptr("<description>"), - Headers: []*armapimanagement.ParameterContract{}, - QueryParameters: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{ - { - ContentType: to.Ptr("<content-type>"), - SchemaID: to.Ptr("<schema-id>"), - TypeName: to.Ptr("<type-name>"), - }}, - }, - Responses: []*armapimanagement.ResponseContract{ - { - Description: to.Ptr("<description>"), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{ - { - ContentType: to.Ptr("<content-type>"), - }, - { - ContentType: to.Ptr("<content-type>"), - }}, - StatusCode: to.Ptr[int32](200), - }}, - Method: to.Ptr("<method>"), - DisplayName: to.Ptr("<display-name>"), - URLTemplate: to.Ptr("<urltemplate>"), - }, - }, - &armapimanagement.APIOperationClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiOperation.json -func ExampleAPIOperationClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<if-match>", - armapimanagement.OperationUpdateContract{ - Properties: &armapimanagement.OperationUpdateContractProperties{ - TemplateParameters: []*armapimanagement.ParameterContract{}, - Request: &armapimanagement.RequestContract{ - QueryParameters: []*armapimanagement.ParameterContract{ - { - Name: to.Ptr("<name>"), - Type: to.Ptr("<type>"), - Description: to.Ptr("<description>"), - DefaultValue: to.Ptr("<default-value>"), - Required: to.Ptr(true), - Values: []*string{ - to.Ptr("sample")}, - }}, - }, - Responses: []*armapimanagement.ResponseContract{ - { - Description: to.Ptr("<description>"), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{}, - StatusCode: to.Ptr[int32](200), - }, - { - Description: to.Ptr("<description>"), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{}, - StatusCode: to.Ptr[int32](500), - }}, - Method: to.Ptr("<method>"), - DisplayName: to.Ptr("<display-name>"), - URLTemplate: to.Ptr("<urltemplate>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperation.json -func ExampleAPIOperationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go deleted file mode 100644 index de1342d1b5f3..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationPolicies.json -func ExampleAPIOperationPolicyClient_ListByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByOperation(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - armapimanagement.PolicyIDNamePolicy, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.APIOperationPolicyClientGetOptions{Format: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.APIOperationPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("<if-match>")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - armapimanagement.PolicyIDNamePolicy, - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go deleted file mode 100644 index ca93fa43a02c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiPolicy.json -func ExampleAPIPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - armapimanagement.PolicyIDNamePolicy, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiPolicy.json -func ExampleAPIPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.APIPolicyClientGetOptions{Format: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicy.json -func ExampleAPIPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.APIPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("<if-match>")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiPolicy.json -func ExampleAPIPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - armapimanagement.PolicyIDNamePolicy, - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go deleted file mode 100644 index 8e67347ffee7..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiProducts.json -func ExampleAPIProductClient_NewListByApisPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByApisPager("<resource-group-name>", - "<service-name>", - "<api-id>", - &armapimanagement.APIProductClientListByApisOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go deleted file mode 100644 index 0b792155dc56..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiReleases.json -func ExampleAPIReleaseClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<api-id>", - &armapimanagement.APIReleaseClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiRelease.json -func ExampleAPIReleaseClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<release-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRelease.json -func ExampleAPIReleaseClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<release-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRelease.json -func ExampleAPIReleaseClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<release-id>", - armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("<apiid>"), - Notes: to.Ptr("<notes>"), - }, - }, - &armapimanagement.APIReleaseClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiRelease.json -func ExampleAPIReleaseClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<release-id>", - "<if-match>", - armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("<apiid>"), - Notes: to.Ptr("<notes>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiRelease.json -func ExampleAPIReleaseClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<release-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go deleted file mode 100644 index 65e91eb643d0..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiRevisions.json -func ExampleAPIRevisionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<api-id>", - &armapimanagement.APIRevisionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go deleted file mode 100644 index caa8e20b9436..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiSchema.json -func ExampleAPISchemaClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<schema-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiSchema.json -func ExampleAPISchemaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<schema-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiSchema.json -func ExampleAPISchemaClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<schema-id>", - armapimanagement.SchemaContract{ - Properties: &armapimanagement.SchemaContractProperties{ - ContentType: to.Ptr("<content-type>"), - Document: &armapimanagement.SchemaDocumentProperties{ - Value: to.Ptr("<value>"), - }, - }, - }, - &armapimanagement.APISchemaClientBeginCreateOrUpdateOptions{IfMatch: nil, - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiSchema.json -func ExampleAPISchemaClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<schema-id>", - "<if-match>", - &armapimanagement.APISchemaClientDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go deleted file mode 100644 index e5c1780936d1..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTagDescriptions.json -func ExampleAPITagDescriptionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<api-id>", - &armapimanagement.APITagDescriptionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTagDescription.json -func ExampleAPITagDescriptionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<tag-description-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTagDescription.json -func ExampleAPITagDescriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<tag-description-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTagDescription.json -func ExampleAPITagDescriptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<tag-description-id>", - armapimanagement.TagDescriptionCreateParameters{ - Properties: &armapimanagement.TagDescriptionBaseProperties{ - Description: to.Ptr("<description>"), - ExternalDocsDescription: to.Ptr("<external-docs-description>"), - ExternalDocsURL: to.Ptr("<external-docs-url>"), - }, - }, - &armapimanagement.APITagDescriptionClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTagDescription.json -func ExampleAPITagDescriptionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<tag-description-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go deleted file mode 100644 index 379fdc91f69c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go +++ /dev/null @@ -1,175 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiVersionSets.json -func ExampleAPIVersionSetClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.APIVersionSetClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiVersionSet.json -func ExampleAPIVersionSetClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<version-set-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiVersionSet.json -func ExampleAPIVersionSetClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<version-set-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiVersionSet.json -func ExampleAPIVersionSetClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<version-set-id>", - armapimanagement.APIVersionSetContract{ - Properties: &armapimanagement.APIVersionSetContractProperties{ - Description: to.Ptr("<description>"), - DisplayName: to.Ptr("<display-name>"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - }, - }, - &armapimanagement.APIVersionSetClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiVersionSet.json -func ExampleAPIVersionSetClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<version-set-id>", - "<if-match>", - armapimanagement.APIVersionSetUpdateParameters{ - Properties: &armapimanagement.APIVersionSetUpdateParametersProperties{ - Description: to.Ptr("<description>"), - DisplayName: to.Ptr("<display-name>"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiVersionSet.json -func ExampleAPIVersionSetClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<version-set-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go deleted file mode 100644 index 881a4a0f6005..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go +++ /dev/null @@ -1,212 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListAuthorizationServers.json -func ExampleAuthorizationServerClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.AuthorizationServerClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadAuthorizationServer.json -func ExampleAuthorizationServerClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetAuthorizationServer.json -func ExampleAuthorizationServerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAuthorizationServer.json -func ExampleAuthorizationServerClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - armapimanagement.AuthorizationServerContract{ - Properties: &armapimanagement.AuthorizationServerContractProperties{ - Description: to.Ptr("<description>"), - AuthorizationMethods: []*armapimanagement.AuthorizationMethod{ - to.Ptr(armapimanagement.AuthorizationMethodGET)}, - BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{ - to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)}, - DefaultScope: to.Ptr("<default-scope>"), - ResourceOwnerPassword: to.Ptr("<resource-owner-password>"), - ResourceOwnerUsername: to.Ptr("<resource-owner-username>"), - SupportState: to.Ptr(true), - TokenEndpoint: to.Ptr("<token-endpoint>"), - AuthorizationEndpoint: to.Ptr("<authorization-endpoint>"), - ClientID: to.Ptr("<client-id>"), - ClientRegistrationEndpoint: to.Ptr("<client-registration-endpoint>"), - ClientSecret: to.Ptr("<client-secret>"), - DisplayName: to.Ptr("<display-name>"), - GrantTypes: []*armapimanagement.GrantType{ - to.Ptr(armapimanagement.GrantTypeAuthorizationCode), - to.Ptr(armapimanagement.GrantTypeImplicit)}, - }, - }, - &armapimanagement.AuthorizationServerClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateAuthorizationServer.json -func ExampleAuthorizationServerClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - "<if-match>", - armapimanagement.AuthorizationServerUpdateContract{ - Properties: &armapimanagement.AuthorizationServerUpdateContractProperties{ - ClientID: to.Ptr("<client-id>"), - ClientSecret: to.Ptr("<client-secret>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteAuthorizationServer.json -func ExampleAuthorizationServerClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementAuthorizationServerListSecrets.json -func ExampleAuthorizationServerClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - "<authsid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go deleted file mode 100644 index 1189b65c170a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go +++ /dev/null @@ -1,229 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListBackends.json -func ExampleBackendClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.BackendClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadBackend.json -func ExampleBackendClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetBackend.json -func ExampleBackendClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendProxyBackend.json -func ExampleBackendClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - armapimanagement.BackendContract{ - Properties: &armapimanagement.BackendContractProperties{ - Description: to.Ptr("<description>"), - Credentials: &armapimanagement.BackendCredentialsContract{ - Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{ - Parameter: to.Ptr("<parameter>"), - Scheme: to.Ptr("<scheme>"), - }, - Header: map[string][]*string{ - "x-my-1": { - to.Ptr("val1"), - to.Ptr("val2")}, - }, - Query: map[string][]*string{ - "sv": { - to.Ptr("xx"), - to.Ptr("bb"), - to.Ptr("cc")}, - }, - }, - Proxy: &armapimanagement.BackendProxyContract{ - Password: to.Ptr("<password>"), - URL: to.Ptr("<url>"), - Username: to.Ptr("<username>"), - }, - TLS: &armapimanagement.BackendTLSProperties{ - ValidateCertificateChain: to.Ptr(true), - ValidateCertificateName: to.Ptr(true), - }, - URL: to.Ptr("<url>"), - Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP), - }, - }, - &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateBackend.json -func ExampleBackendClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - "<if-match>", - armapimanagement.BackendUpdateParameters{ - Properties: &armapimanagement.BackendUpdateParameterProperties{ - Description: to.Ptr("<description>"), - TLS: &armapimanagement.BackendTLSProperties{ - ValidateCertificateChain: to.Ptr(false), - ValidateCertificateName: to.Ptr(true), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteBackend.json -func ExampleBackendClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackendReconnect.json -func ExampleBackendClient_Reconnect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Reconnect(ctx, - "<resource-group-name>", - "<service-name>", - "<backend-id>", - &armapimanagement.BackendClientReconnectOptions{Parameters: &armapimanagement.BackendReconnectContract{ - Properties: &armapimanagement.BackendReconnectProperties{ - After: to.Ptr("<after>"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go deleted file mode 100644 index 5ffa92f49da0..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCaches.json -func ExampleCacheClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.CacheClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCache.json -func ExampleCacheClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<cache-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCache.json -func ExampleCacheClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<cache-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCache.json -func ExampleCacheClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<cache-id>", - armapimanagement.CacheContract{ - Properties: &armapimanagement.CacheContractProperties{ - Description: to.Ptr("<description>"), - ConnectionString: to.Ptr("<connection-string>"), - ResourceID: to.Ptr("<resource-id>"), - UseFromLocation: to.Ptr("<use-from-location>"), - }, - }, - &armapimanagement.CacheClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateCache.json -func ExampleCacheClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<cache-id>", - "<if-match>", - armapimanagement.CacheUpdateParameters{ - Properties: &armapimanagement.CacheUpdateProperties{ - UseFromLocation: to.Ptr("<use-from-location>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCache.json -func ExampleCacheClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<cache-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go deleted file mode 100644 index 5c276efb4f2e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCertificates.json -func ExampleCertificateClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.CertificateClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - IsKeyVaultRefreshFailed: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCertificate.json -func ExampleCertificateClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<certificate-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificate.json -func ExampleCertificateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<certificate-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificate.json -func ExampleCertificateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<certificate-id>", - armapimanagement.CertificateCreateOrUpdateParameters{ - Properties: &armapimanagement.CertificateCreateOrUpdateProperties{ - Data: to.Ptr("<data>"), - Password: to.Ptr("<password>"), - }, - }, - &armapimanagement.CertificateClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCertificate.json -func ExampleCertificateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<certificate-id>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshCertificate.json -func ExampleCertificateClient_RefreshSecret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RefreshSecret(ctx, - "<resource-group-name>", - "<service-name>", - "<certificate-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go deleted file mode 100644 index f7b98a0aee41..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypeContentItems.json -func ExampleContentItemClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<content-type-id>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadContentTypeContentItem.json -func ExampleContentItemClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - "<content-item-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentTypeContentItem.json -func ExampleContentItemClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - "<content-item-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentTypeContentItem.json -func ExampleContentItemClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - "<content-item-id>", - &armapimanagement.ContentItemClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentTypeContentItem.json -func ExampleContentItemClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - "<content-item-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go deleted file mode 100644 index 4ad4becbb27b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypes.json -func ExampleContentTypeClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentType.json -func ExampleContentTypeClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentType.json -func ExampleContentTypeClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - &armapimanagement.ContentTypeClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentType.json -func ExampleContentTypeClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<content-type-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go deleted file mode 100644 index 5ef417f043f8..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDelegationSettings.json -func ExampleDelegationSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetDelegation.json -func ExampleDelegationSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.json -func ExampleDelegationSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<if-match>", - armapimanagement.PortalDelegationSettings{ - Properties: &armapimanagement.PortalDelegationSettingsProperties{ - Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - URL: to.Ptr("<url>"), - UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - ValidationKey: to.Ptr("<validation-key>"), - }, - }, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutDelegation.json -func ExampleDelegationSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PortalDelegationSettings{ - Properties: &armapimanagement.PortalDelegationSettingsProperties{ - Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - URL: to.Ptr("<url>"), - UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - ValidationKey: to.Ptr("<validation-key>"), - }, - }, - &armapimanagement.DelegationSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("<if-match>")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json -func ExampleDelegationSettingsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go deleted file mode 100644 index 71a4de042480..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesListBySubscription.json -func ExampleDeletedServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDeletedServiceByName.json -func ExampleDeletedServicesClient_GetByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByName(ctx, - "<service-name>", - "<location>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesPurge.json -func ExampleDeletedServicesClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPurge(ctx, - "<service-name>", - "<location>", - &armapimanagement.DeletedServicesClientBeginPurgeOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go deleted file mode 100644 index 1919d1216b85..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go +++ /dev/null @@ -1,245 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListDiagnostics.json -func ExampleDiagnosticClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.DiagnosticClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDiagnostic.json -func ExampleDiagnosticClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<diagnostic-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDiagnostic.json -func ExampleDiagnosticClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<diagnostic-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateDiagnostic.json -func ExampleDiagnosticClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<diagnostic-id>", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("<logger-id>"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - &armapimanagement.DiagnosticClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateDiagnostic.json -func ExampleDiagnosticClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<diagnostic-id>", - "<if-match>", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("<logger-id>"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteDiagnostic.json -func ExampleDiagnosticClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<diagnostic-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go deleted file mode 100644 index ca3f9f4c13e0..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTemplates.json -func ExampleEmailTemplateClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.EmailTemplateClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadEmailTemplate.json -func ExampleEmailTemplateClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.TemplateNameNewIssueNotificationMessage, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTemplate.json -func ExampleEmailTemplateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.TemplateNameNewIssueNotificationMessage, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTemplate.json -func ExampleEmailTemplateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.TemplateNameNewIssueNotificationMessage, - armapimanagement.EmailTemplateUpdateParameters{ - Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{ - Subject: to.Ptr("<subject>"), - }, - }, - &armapimanagement.EmailTemplateClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTemplate.json -func ExampleEmailTemplateClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.TemplateNameNewIssueNotificationMessage, - "<if-match>", - armapimanagement.EmailTemplateUpdateParameters{ - Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{ - Body: to.Ptr("<body>"), - Subject: to.Ptr("<subject>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTemplate.json -func ExampleEmailTemplateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.TemplateNameNewIssueNotificationMessage, - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go deleted file mode 100644 index 0b291f26eb2c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go +++ /dev/null @@ -1,253 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGateways.json -func ExampleGatewayClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.GatewayClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGateway.json -func ExampleGatewayClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGateway.json -func ExampleGatewayClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGateway.json -func ExampleGatewayClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("<description>"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("<name>"), - }, - }, - }, - &armapimanagement.GatewayClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGateway.json -func ExampleGatewayClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<if-match>", - armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("<description>"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("<name>"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGateway.json -func ExampleGatewayClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayListKeys.json -func ExampleGatewayClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayRegenerateKey.json -func ExampleGatewayClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateKey(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - armapimanagement.GatewayKeyRegenerationRequestContract{ - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayGenerateToken.json -func ExampleGatewayClient_GenerateToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateToken(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - armapimanagement.GatewayTokenRequestContract{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-21T00:44:24.2845269Z"); return t }()), - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go deleted file mode 100644 index ca3229b2ec69..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayApis.json -func ExampleGatewayAPIClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<gateway-id>", - &armapimanagement.GatewayAPIClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayApi.json -func ExampleGatewayAPIClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<api-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayApi.json -func ExampleGatewayAPIClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<api-id>", - &armapimanagement.GatewayAPIClientCreateOrUpdateOptions{Parameters: &armapimanagement.AssociationContract{ - Properties: &armapimanagement.AssociationContractProperties{ - ProvisioningState: to.Ptr("<provisioning-state>"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayApi.json -func ExampleGatewayAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<api-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go deleted file mode 100644 index 3a447efd1b34..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json -func ExampleGatewayCertificateAuthorityClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<gateway-id>", - &armapimanagement.GatewayCertificateAuthorityClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<certificate-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<certificate-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<certificate-id>", - armapimanagement.GatewayCertificateAuthorityContract{ - Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{ - IsTrusted: to.Ptr(false), - }, - }, - &armapimanagement.GatewayCertificateAuthorityClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<certificate-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go deleted file mode 100644 index 20cea4cffcc5..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json -func ExampleGatewayHostnameConfigurationClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - "<gateway-id>", - &armapimanagement.GatewayHostnameConfigurationClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<hc-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<hc-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<hc-id>", - armapimanagement.GatewayHostnameConfigurationContract{ - Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{ - CertificateID: to.Ptr("<certificate-id>"), - Hostname: to.Ptr("<hostname>"), - HTTP2Enabled: to.Ptr(true), - NegotiateClientCertificate: to.Ptr(false), - Tls10Enabled: to.Ptr(false), - Tls11Enabled: to.Ptr(false), - }, - }, - &armapimanagement.GatewayHostnameConfigurationClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<gateway-id>", - "<hc-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go deleted file mode 100644 index 5ff2f5689c86..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go +++ /dev/null @@ -1,152 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json -func ExampleGlobalSchemaClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.GlobalSchemaClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json -func ExampleGlobalSchemaClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<schema-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json -func ExampleGlobalSchemaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<schema-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json -func ExampleGlobalSchemaClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<schema-id>", - armapimanagement.GlobalSchemaContract{ - Properties: &armapimanagement.GlobalSchemaContractProperties{ - Description: to.Ptr("<description>"), - SchemaType: to.Ptr(armapimanagement.SchemaTypeXML), - Value: "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n elementFormDefault=\"qualified\">\r\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n <xsd:complexType name=\"PurchaseOrderType\">\r\n <xsd:sequence>\r\n <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n </xsd:sequence>\r\n <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n </xsd:complexType>\r\n\r\n <xsd:complexType name=\"USAddress\">\r\n <xsd:sequence>\r\n <xsd:element name=\"name\" type=\"xsd:string\"/>\r\n <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n <xsd:element name=\"city\" type=\"xsd:string\"/>\r\n <xsd:element name=\"state\" type=\"xsd:string\"/>\r\n <xsd:element name=\"zip\" type=\"xsd:integer\"/>\r\n </xsd:sequence>\r\n <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n </xsd:complexType>\r\n</xsd:schema>", - }, - }, - &armapimanagement.GlobalSchemaClientBeginCreateOrUpdateOptions{IfMatch: nil, - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json -func ExampleGlobalSchemaClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<schema-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go deleted file mode 100644 index 970927766aa2..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroups.json -func ExampleGroupClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.GroupClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroup.json -func ExampleGroupClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGroup.json -func ExampleGroupClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroup.json -func ExampleGroupClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - armapimanagement.GroupCreateParameters{ - Properties: &armapimanagement.GroupCreateParametersProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGroup.json -func ExampleGroupClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - "<if-match>", - armapimanagement.GroupUpdateParameters{ - Properties: &armapimanagement.GroupUpdateParametersProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroup.json -func ExampleGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go deleted file mode 100644 index d50252411f83..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroupUsers.json -func ExampleGroupUserClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - "<group-id>", - &armapimanagement.GroupUserClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroupUser.json -func ExampleGroupUserClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - "<user-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupUser.json -func ExampleGroupUserClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - "<user-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroupUser.json -func ExampleGroupUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<group-id>", - "<user-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go deleted file mode 100644 index c1b996df8a02..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIdentityProviders.json -func ExampleIdentityProviderClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadIdentityProvider.json -func ExampleIdentityProviderClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeAADB2C, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIdentityProvider.json -func ExampleIdentityProviderClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeAADB2C, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateIdentityProvider.json -func ExampleIdentityProviderClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeFacebook, - armapimanagement.IdentityProviderCreateContract{ - Properties: &armapimanagement.IdentityProviderCreateContractProperties{ - ClientID: to.Ptr("<client-id>"), - ClientSecret: to.Ptr("<client-secret>"), - }, - }, - &armapimanagement.IdentityProviderClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateIdentityProvider.json -func ExampleIdentityProviderClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeFacebook, - "<if-match>", - armapimanagement.IdentityProviderUpdateParameters{ - Properties: &armapimanagement.IdentityProviderUpdateProperties{ - ClientID: to.Ptr("<client-id>"), - ClientSecret: to.Ptr("<client-secret>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteIdentityProvider.json -func ExampleIdentityProviderClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeAAD, - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementIdentityProviderListSecrets.json -func ExampleIdentityProviderClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.IdentityProviderTypeAADB2C, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go deleted file mode 100644 index 6ede82762333..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIssues.json -func ExampleIssueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIssueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.IssueClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIssue.json -func ExampleIssueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIssueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<issue-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go deleted file mode 100644 index 7a3b6d03ea3b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListLoggers.json -func ExampleLoggerClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.LoggerClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadLogger.json -func ExampleLoggerClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<logger-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetLogger.json -func ExampleLoggerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<logger-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAILogger.json -func ExampleLoggerClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<logger-id>", - armapimanagement.LoggerContract{ - Properties: &armapimanagement.LoggerContractProperties{ - Description: to.Ptr("<description>"), - Credentials: map[string]*string{ - "instrumentationKey": to.Ptr("11................a1"), - }, - LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights), - }, - }, - &armapimanagement.LoggerClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateLogger.json -func ExampleLoggerClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<logger-id>", - "<if-match>", - armapimanagement.LoggerUpdateContract{ - Properties: &armapimanagement.LoggerUpdateParameters{ - Description: to.Ptr("<description>"), - LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteLogger.json -func ExampleLoggerClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<logger-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go deleted file mode 100644 index 99b96901bdcf..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go +++ /dev/null @@ -1,244 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNamedValues.json -func ExampleNamedValueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.NamedValueClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - IsKeyVaultRefreshFailed: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNamedValue.json -func ExampleNamedValueClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValue.json -func ExampleNamedValueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValue.json -func ExampleNamedValueClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - armapimanagement.NamedValueCreateContract{ - Properties: &armapimanagement.NamedValueCreateContractProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar")}, - DisplayName: to.Ptr("<display-name>"), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.NamedValueClientBeginCreateOrUpdateOptions{IfMatch: nil, - ResumeToken: "", - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.json -func ExampleNamedValueClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - "<if-match>", - armapimanagement.NamedValueUpdateParameters{ - Properties: &armapimanagement.NamedValueUpdateParameterProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar2")}, - DisplayName: to.Ptr("<display-name>"), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.NamedValueClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNamedValue.json -func ExampleNamedValueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementNamedValueListValue.json -func ExampleNamedValueClient_ListValue() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListValue(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshNamedValue.json -func ExampleNamedValueClient_BeginRefreshSecret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshSecret(ctx, - "<resource-group-name>", - "<service-name>", - "<named-value-id>", - &armapimanagement.NamedValueClientBeginRefreshSecretOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go deleted file mode 100644 index 18a7a1af48ae..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatus.json -func ExampleNetworkStatusClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNetworkStatusClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json -func ExampleNetworkStatusClient_ListByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNetworkStatusClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByLocation(ctx, - "<resource-group-name>", - "<service-name>", - "<location-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go deleted file mode 100644 index 1648e64eadc4..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotifications.json -func ExampleNotificationClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.NotificationClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNotification.json -func ExampleNotificationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotification.json -func ExampleNotificationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - &armapimanagement.NotificationClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go deleted file mode 100644 index b35b2c23aaff..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientEmails.json -func ExampleNotificationRecipientEmailClient_ListByNotification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByNotification(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<email>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<email>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<email>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go deleted file mode 100644 index aa22ecfa1468..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientUsers.json -func ExampleNotificationRecipientUserClient_ListByNotification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByNotification(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<user-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<user-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "<user-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go deleted file mode 100644 index 4d8e3707623e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOpenIdConnectProviders.json -func ExampleOpenIDConnectProviderClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.OpenIDConnectProviderClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - armapimanagement.OpenidConnectProviderContract{ - Properties: &armapimanagement.OpenidConnectProviderContractProperties{ - ClientID: to.Ptr("<client-id>"), - ClientSecret: to.Ptr("<client-secret>"), - DisplayName: to.Ptr("<display-name>"), - MetadataEndpoint: to.Ptr("<metadata-endpoint>"), - }, - }, - &armapimanagement.OpenIDConnectProviderClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - "<if-match>", - armapimanagement.OpenidConnectProviderUpdateContract{ - Properties: &armapimanagement.OpenidConnectProviderUpdateContractProperties{ - ClientSecret: to.Ptr("<client-secret>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json -func ExampleOpenIDConnectProviderClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - "<opid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go deleted file mode 100644 index 813ef8b8464b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationsByTags.json -func ExampleOperationClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOperationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("<resource-group-name>", - "<service-name>", - "<api-id>", - &armapimanagement.OperationClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedOperations: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go deleted file mode 100644 index 877d5b395478..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json -func ExampleOutboundNetworkDependenciesEndpointsClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOutboundNetworkDependenciesEndpointsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go deleted file mode 100644 index cce415e72011..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicies.json -func ExamplePolicyClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPolicy.json -func ExamplePolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PolicyIDNamePolicy, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicy.json -func ExamplePolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.PolicyClientGetOptions{Format: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePolicy.json -func ExamplePolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.PolicyClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePolicy.json -func ExamplePolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PolicyIDNamePolicy, - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go deleted file mode 100644 index f670e8e6f9a8..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicyDescriptions.json -func ExamplePolicyDescriptionClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyDescriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - &armapimanagement.PolicyDescriptionClientListByServiceOptions{Scope: to.Ptr(armapimanagement.PolicyScopeContractAPI)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go deleted file mode 100644 index 0adb39d99e03..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalRevisions.json -func ExamplePortalRevisionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.PortalRevisionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPortalRevision.json -func ExamplePortalRevisionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<portal-revision-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPortalRevision.json -func ExamplePortalRevisionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<portal-revision-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePortalRevision.json -func ExamplePortalRevisionClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<portal-revision-id>", - armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("<description>"), - IsCurrent: to.Ptr(true), - }, - }, - &armapimanagement.PortalRevisionClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdatePortalRevision.json -func ExamplePortalRevisionClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<portal-revision-id>", - "<if-match>", - armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("<description>"), - IsCurrent: to.Ptr(true), - }, - }, - &armapimanagement.PortalRevisionClientBeginUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go deleted file mode 100644 index 886aab806766..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalSettings.json -func ExamplePortalSettingsClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go deleted file mode 100644 index f4b2174cecc4..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_GetByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByName(ctx, - "<resource-group-name>", - "<service-name>", - "<private-endpoint-connection-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<private-endpoint-connection-name>", - armapimanagement.PrivateEndpointConnectionRequest{ - ID: to.Ptr("<id>"), - Properties: &armapimanagement.PrivateEndpointConnectionRequestProperties{ - PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{ - Description: to.Ptr("<description>"), - Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - &armapimanagement.PrivateEndpointConnectionClientBeginCreateOrUpdateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "<resource-group-name>", - "<service-name>", - "<private-endpoint-connection-name>", - &armapimanagement.PrivateEndpointConnectionClientBeginDeleteOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateLinkGroupResources.json -func ExamplePrivateEndpointConnectionClient_ListPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPrivateLinkResources(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json -func ExamplePrivateEndpointConnectionClient_GetPrivateLinkResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPrivateLinkResource(ctx, - "<resource-group-name>", - "<service-name>", - "<private-link-sub-resource-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go deleted file mode 100644 index 433dce427615..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go +++ /dev/null @@ -1,204 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProducts.json -func ExampleProductClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.ProductClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: nil, - Tags: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProduct.json -func ExampleProductClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProduct.json -func ExampleProductClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProduct.json -func ExampleProductClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - armapimanagement.ProductContract{ - Properties: &armapimanagement.ProductContractProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - &armapimanagement.ProductClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateProduct.json -func ExampleProductClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<if-match>", - armapimanagement.ProductUpdateParameters{ - Properties: &armapimanagement.ProductUpdateProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProduct.json -func ExampleProductClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<if-match>", - &armapimanagement.ProductClientDeleteOptions{DeleteSubscriptions: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductsByTags.json -func ExampleProductClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("<resource-group-name>", - "<service-name>", - &armapimanagement.ProductClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedProducts: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go deleted file mode 100644 index e5c0ab0148ab..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductApis.json -func ExampleProductAPIClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("<resource-group-name>", - "<service-name>", - "<product-id>", - &armapimanagement.ProductAPIClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductApi.json -func ExampleProductAPIClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<api-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductApi.json -func ExampleProductAPIClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<api-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductApi.json -func ExampleProductAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<api-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go deleted file mode 100644 index 65fc2cbf3418..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductGroups.json -func ExampleProductGroupClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("<resource-group-name>", - "<service-name>", - "<product-id>", - &armapimanagement.ProductGroupClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductGroup.json -func ExampleProductGroupClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<group-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductGroup.json -func ExampleProductGroupClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<group-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductGroup.json -func ExampleProductGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<group-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go deleted file mode 100644 index 36b04ccb8c01..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go +++ /dev/null @@ -1,140 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductPolicies.json -func ExampleProductPolicyClient_ListByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByProduct(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductPolicy.json -func ExampleProductPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - armapimanagement.PolicyIDNamePolicy, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductPolicy.json -func ExampleProductPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.ProductPolicyClientGetOptions{Format: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductPolicy.json -func ExampleProductPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("<value>"), - }, - }, - &armapimanagement.ProductPolicyClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductPolicy.json -func ExampleProductPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - armapimanagement.PolicyIDNamePolicy, - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go deleted file mode 100644 index daa30a5ef996..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductSubscriptions.json -func ExampleProductSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductSubscriptionsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - "<product-id>", - &armapimanagement.ProductSubscriptionsClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go deleted file mode 100644 index 7413c5c88fe9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeys.json -func ExampleQuotaByCounterKeysClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByCounterKeysClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "<resource-group-name>", - "<service-name>", - "<quota-counter-key>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKey.json -func ExampleQuotaByCounterKeysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByCounterKeysClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<quota-counter-key>", - armapimanagement.QuotaCounterValueUpdateContract{ - Properties: &armapimanagement.QuotaCounterValueContractProperties{ - CallsCount: to.Ptr[int32](0), - KbTransferred: to.Ptr[float64](2.5630078125), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go deleted file mode 100644 index 3c46edbce09c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json -func ExampleQuotaByPeriodKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByPeriodKeysClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<quota-counter-key>", - "<quota-period-key>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.json -func ExampleQuotaByPeriodKeysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByPeriodKeysClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<quota-counter-key>", - "<quota-period-key>", - armapimanagement.QuotaCounterValueUpdateContract{ - Properties: &armapimanagement.QuotaCounterValueContractProperties{ - CallsCount: to.Ptr[int32](0), - KbTransferred: to.Ptr[float64](0), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go deleted file mode 100644 index ce038b7d75d4..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListRegions.json -func ExampleRegionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewRegionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go deleted file mode 100644 index 2ab543d43ee9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByUser.json -func ExampleReportsClient_NewListByUserPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByUserPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListByUserOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByOperation.json -func ExampleReportsClient_NewListByOperationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByOperationPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListByOperationOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByProduct.json -func ExampleReportsClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListByProductOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByGeo.json -func ExampleReportsClient_NewListByGeoPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGeoPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListByGeoOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsBySubscription.json -func ExampleReportsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListBySubscriptionOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByTime.json -func ExampleReportsClient_NewListByTimePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTimePager("<resource-group-name>", - "<service-name>", - "<filter>", - "<interval>", - &armapimanagement.ReportsClientListByTimeOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByRequest.json -func ExampleReportsClient_NewListByRequestPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRequestPager("<resource-group-name>", - "<service-name>", - "<filter>", - &armapimanagement.ReportsClientListByRequestOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go deleted file mode 100644 index 4801bb9a3add..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go +++ /dev/null @@ -1,113 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignInSettings.json -func ExampleSignInSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignIn.json -func ExampleSignInSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.json -func ExampleSignInSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<if-match>", - armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.json -func ExampleSignInSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, - &armapimanagement.SignInSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("<if-match>")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go deleted file mode 100644 index 9756bedbea9c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignUpSettings.json -func ExampleSignUpSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignUp.json -func ExampleSignUpSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.json -func ExampleSignUpSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<if-match>", - armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("<text>"), - }, - }, - }, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignUp.json -func ExampleSignUpSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("<text>"), - }, - }, - }, - &armapimanagement.SignUpSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("<if-match>")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go deleted file mode 100644 index 56b048333bc9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go +++ /dev/null @@ -1,243 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSubscriptions.json -func ExampleSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - &armapimanagement.SubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSubscription.json -func ExampleSubscriptionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetSubscription.json -func ExampleSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSubscription.json -func ExampleSubscriptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - armapimanagement.SubscriptionCreateParameters{ - Properties: &armapimanagement.SubscriptionCreateParameterProperties{ - DisplayName: to.Ptr("<display-name>"), - OwnerID: to.Ptr("<owner-id>"), - Scope: to.Ptr("<scope>"), - }, - }, - &armapimanagement.SubscriptionClientCreateOrUpdateOptions{Notify: nil, - IfMatch: nil, - AppType: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateSubscription.json -func ExampleSubscriptionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - "<if-match>", - armapimanagement.SubscriptionUpdateParameters{ - Properties: &armapimanagement.SubscriptionUpdateParameterProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - &armapimanagement.SubscriptionClientUpdateOptions{Notify: nil, - AppType: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteSubscription.json -func ExampleSubscriptionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - "<if-match>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json -func ExampleSubscriptionClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json -func ExampleSubscriptionClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionListSecrets.json -func ExampleSubscriptionClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - "<sid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go deleted file mode 100644 index 658ca6b10529..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go +++ /dev/null @@ -1,423 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationTags.json -func ExampleTagClient_NewListByOperationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByOperationPager("<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - &armapimanagement.TagClientListByOperationOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationTag.json -func ExampleTagClient_GetEntityStateByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityStateByOperation(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<tag-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationTag.json -func ExampleTagClient_GetByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByOperation(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<tag-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationTag.json -func ExampleTagClient_AssignToOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AssignToOperation(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<tag-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationTag.json -func ExampleTagClient_DetachFromOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DetachFromOperation(ctx, - "<resource-group-name>", - "<service-name>", - "<api-id>", - "<operation-id>", - "<tag-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductTags.json -func ExampleTagClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("<resource-group-name>", - "<service-name>", - "<product-id>", - &armapimanagement.TagClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductTag.json -func ExampleTagClient_GetEntityStateByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityStateByProduct(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<tag-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductTag.json -func ExampleTagClient_GetByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByProduct(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<tag-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductTag.json -func ExampleTagClient_AssignToProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AssignToProduct(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<tag-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductTag.json -func ExampleTagClient_DetachFromProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DetachFromProduct(ctx, - "<resource-group-name>", - "<service-name>", - "<product-id>", - "<tag-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTags.json -func ExampleTagClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.TagClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Scope: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTag.json -func ExampleTagClient_GetEntityState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityState(ctx, - "<resource-group-name>", - "<service-name>", - "<tag-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTag.json -func ExampleTagClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<tag-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTag.json -func ExampleTagClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<tag-id>", - armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTag.json -func ExampleTagClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<tag-id>", - "<if-match>", - armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("<display-name>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTag.json -func ExampleTagClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<tag-id>", - "<if-match>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go deleted file mode 100644 index 543d6eb30a64..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTagResources.json -func ExampleTagResourceClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagResourceClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.TagResourceClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go deleted file mode 100644 index 6b2985fba570..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go +++ /dev/null @@ -1,212 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantAccess.json -func ExampleTenantAccessClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.TenantAccessClientListByServiceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTenantAccess.json -func ExampleTenantAccessClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantAccess.json -func ExampleTenantAccessClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTenantAccess.json -func ExampleTenantAccessClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - "<if-match>", - armapimanagement.AccessInformationCreateParameters{ - Properties: &armapimanagement.AccessInformationCreateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTenantAccess.json -func ExampleTenantAccessClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - "<if-match>", - armapimanagement.AccessInformationUpdateParameters{ - Properties: &armapimanagement.AccessInformationUpdateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsTenantAccess.json -func ExampleTenantAccessClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go deleted file mode 100644 index f4ae7af6fc32..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessGitClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessGitClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessGitClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessGitClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.AccessIDNameAccess, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go deleted file mode 100644 index 5795882d047a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go +++ /dev/null @@ -1,139 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationDeploy.json -func ExampleTenantConfigurationClient_BeginDeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeploy(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("<branch>"), - }, - }, - &armapimanagement.TenantConfigurationClientBeginDeployOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationSave.json -func ExampleTenantConfigurationClient_BeginSave() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSave(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.SaveConfigurationParameter{ - Properties: &armapimanagement.SaveConfigurationParameterProperties{ - Branch: to.Ptr("<branch>"), - }, - }, - &armapimanagement.TenantConfigurationClientBeginSaveOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationValidate.json -func ExampleTenantConfigurationClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidate(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("<branch>"), - }, - }, - &armapimanagement.TenantConfigurationClientBeginValidateOptions{ResumeToken: ""}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessSyncState.json -func ExampleTenantConfigurationClient_GetSyncState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSyncState(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.ConfigurationIDNameConfiguration, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go deleted file mode 100644 index 8ae6c42a04c2..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantSettings.json -func ExampleTenantSettingsClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.TenantSettingsClientListByServiceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantSettings.json -func ExampleTenantSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantSettingsClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - armapimanagement.SettingsTypeNamePublic, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go deleted file mode 100644 index 32ae184d0418..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go +++ /dev/null @@ -1,213 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUsers.json -func ExampleUserClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("<resource-group-name>", - "<service-name>", - &armapimanagement.UserClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadUser.json -func ExampleUserClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUser.json -func ExampleUserClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateUser.json -func ExampleUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - armapimanagement.UserCreateParameters{ - Properties: &armapimanagement.UserCreateParameterProperties{ - Confirmation: to.Ptr(armapimanagement.ConfirmationSignup), - Email: to.Ptr("<email>"), - FirstName: to.Ptr("<first-name>"), - LastName: to.Ptr("<last-name>"), - }, - }, - &armapimanagement.UserClientCreateOrUpdateOptions{Notify: nil, - IfMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateUser.json -func ExampleUserClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - "<if-match>", - armapimanagement.UserUpdateParameters{ - Properties: &armapimanagement.UserUpdateParametersProperties{ - Email: to.Ptr("<email>"), - FirstName: to.Ptr("<first-name>"), - LastName: to.Ptr("<last-name>"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteUser.json -func ExampleUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - "<if-match>", - &armapimanagement.UserClientDeleteOptions{DeleteSubscriptions: nil, - Notify: nil, - AppType: 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/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserToken.json -func ExampleUserClient_GetSharedAccessToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSharedAccessToken(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - armapimanagement.UserTokenParameters{ - Properties: &armapimanagement.UserTokenParameterProperties{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T00:44:24.2845269Z"); return t }()), - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go deleted file mode 100644 index f0a3a025dafa..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserConfirmationPasswordSend.json -func ExampleUserConfirmationPasswordClient_Send() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserConfirmationPasswordClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Send(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - &armapimanagement.UserConfirmationPasswordClientSendOptions{AppType: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go deleted file mode 100644 index fe93f067a86c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserGroups.json -func ExampleUserGroupClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserGroupClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - "<user-id>", - &armapimanagement.UserGroupClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go deleted file mode 100644 index 1ef1facd9e68..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserIdentities.json -func ExampleUserIdentitiesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserIdentitiesClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - "<user-id>", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go deleted file mode 100644 index e113babc4fe5..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserSubscriptions.json -func ExampleUserSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("<resource-group-name>", - "<service-name>", - "<user-id>", - &armapimanagement.UserSubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUserSubscription.json -func ExampleUserSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserSubscriptionClient("<subscription-id>", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "<resource-group-name>", - "<service-name>", - "<user-id>", - "<sid>", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go b/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go index eec3fd283df8..11410f0033c8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go @@ -10,7 +10,7 @@ package armapimanagement const ( moduleName = "armapimanagement" - moduleVersion = "v0.5.0" + moduleVersion = "v0.5.1" ) // APIManagementSKUCapacityScaleType - The scale type applicable to the sku. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go index 81c3586787e4..2140442d81bb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go @@ -248,7 +248,7 @@ func (client *PrivateEndpointConnectionClient) getByNameHandleResponse(resp *htt return result, nil } -// GetPrivateLinkResource - Description for Gets the private link resources +// GetPrivateLinkResource - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. // serviceName - The name of the API Management service. @@ -372,7 +372,7 @@ func (client *PrivateEndpointConnectionClient) listByServiceHandleResponse(resp return result, nil } -// ListPrivateLinkResources - Description for Gets the private link resources +// ListPrivateLinkResources - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. // serviceName - The name of the API Management service.