From c878dd538ce47f85a3689eb0aa02c3094c27ac5e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Apr 2022 06:05:46 +0000 Subject: [PATCH] CodeGen from PR 18617 in Azure/azure-rest-api-specs Merge 13c53b8973cd548980cf895f04ff214e44c0b5a9 into b52f90085693d0ec65f751e30c65c3a878c340ea --- .../postgresql/armpostgresql/CHANGELOG.md | 10 + .../postgresql/armpostgresql/autorest.md | 6 +- .../postgresql/armpostgresql/go.mod | 5 +- .../postgresql/armpostgresql/go.sum | 32 +--- ...ample_checknameavailability_client_test.go | 38 ---- ...ated_example_configurations_client_test.go | 86 --------- ...generated_example_databases_client_test.go | 108 ----------- ...rated_example_firewallrules_client_test.go | 108 ----------- ...ocationbasedperformancetier_client_test.go | 34 ---- ..._generated_example_logfiles_client_test.go | 35 ---- ...enerated_example_operations_client_test.go | 33 ---- ..._privateendpointconnections_client_test.go | 147 -------------- ...xample_privatelinkresources_client_test.go | 61 ------ ..._example_recoverableservers_client_test.go | 35 ---- ..._generated_example_replicas_client_test.go | 35 ---- ...xample_serveradministrators_client_test.go | 107 ----------- ..._serverbasedperformancetier_client_test.go | 35 ---- ...enerated_example_serverkeys_client_test.go | 115 ----------- ...ed_example_serverparameters_client_test.go | 42 ---- ...e_generated_example_servers_client_test.go | 181 ------------------ ...serversecurityalertpolicies_client_test.go | 101 ---------- ...example_virtualnetworkrules_client_test.go | 115 ----------- ..._generated_checknameavailability_client.go | 14 +- .../zz_generated_configurations_client.go | 14 +- .../armpostgresql/zz_generated_constants.go | 2 +- .../zz_generated_databases_client.go | 14 +- .../zz_generated_firewallrules_client.go | 14 +- ...ted_locationbasedperformancetier_client.go | 14 +- .../zz_generated_logfiles_client.go | 14 +- .../armpostgresql/zz_generated_models.go | 48 +---- .../zz_generated_operations_client.go | 14 +- ...rated_privateendpointconnections_client.go | 14 +- ...z_generated_privatelinkresources_client.go | 14 +- .../zz_generated_recoverableservers_client.go | 14 +- .../zz_generated_replicas_client.go | 14 +- ...z_generated_serveradministrators_client.go | 14 +- ...rated_serverbasedperformancetier_client.go | 14 +- .../zz_generated_serverkeys_client.go | 14 +- .../zz_generated_serverparameters_client.go | 14 +- .../zz_generated_servers_client.go | 14 +- ...ated_serversecurityalertpolicies_client.go | 14 +- ...zz_generated_virtualnetworkrules_client.go | 14 +- 42 files changed, 146 insertions(+), 1625 deletions(-) delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_checknameavailability_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_configurations_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_databases_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_firewallrules_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_locationbasedperformancetier_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_logfiles_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_recoverableservers_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_replicas_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serveradministrators_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverbasedperformancetier_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverkeys_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverparameters_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_servers_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serversecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_virtualnetworkrules_client_test.go diff --git a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md index 0a9028b78c02..551550ccfc68 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 0.4.0 (2022-04-08) +### Breaking Changes + +- Type of `Operation.Properties` has been changed from `map[string]map[string]interface{}` to `map[string]interface{}` +- Function `ErrorResponse.MarshalJSON` has been removed +- Struct `CloudError` has been removed +- Struct `ErrorAdditionalInfo` has been removed +- Struct `ErrorResponse` has been removed + + ## 0.3.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md index 713274203188..1465d441898b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/autorest.md +++ b/sdk/resourcemanager/postgresql/armpostgresql/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/postgresql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/postgresql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.3.1 +module-version: 0.4.0 package-singleservers: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/postgresql/armpostgresql/go.mod b/sdk/resourcemanager/postgresql/armpostgresql/go.mod index 1aa66019892a..a1a82b3018ea 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/go.mod +++ b/sdk/resourcemanager/postgresql/armpostgresql/go.mod @@ -2,7 +2,4 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostg go 1.16 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 diff --git a/sdk/resourcemanager/postgresql/armpostgresql/go.sum b/sdk/resourcemanager/postgresql/armpostgresql/go.sum index 2ce51d3b8174..e0ad585956d9 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/go.sum +++ b/sdk/resourcemanager/postgresql/armpostgresql/go.sum @@ -1,26 +1,11 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/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,32 +13,23 @@ 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-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -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/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-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/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/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= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_checknameavailability_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_checknameavailability_client_test.go deleted file mode 100644 index dfc4c7baf83f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_checknameavailability_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/CheckNameAvailability.json -func ExampleCheckNameAvailabilityClient_Execute() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewCheckNameAvailabilityClient("", cred, nil) - res, err := client.Execute(ctx, - armpostgresql.NameAvailabilityRequest{ - Name: to.StringPtr(""), - Type: to.StringPtr(""), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.CheckNameAvailabilityClientExecuteResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_configurations_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_configurations_client_test.go deleted file mode 100644 index 62c642a2ecd3..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_configurations_client_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationCreateOrUpdate.json -func ExampleConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewConfigurationsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.Configuration{ - Properties: &armpostgresql.ConfigurationProperties{ - Source: to.StringPtr(""), - Value: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ConfigurationsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationGet.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewConfigurationsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ConfigurationsClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationListByServer.json -func ExampleConfigurationsClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewConfigurationsClient("", cred, nil) - res, err := client.ListByServer(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ConfigurationsClientListByServerResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_databases_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_databases_client_test.go deleted file mode 100644 index b6e8fa10a90a..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_databases_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseCreate.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewDatabasesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.Database{ - Properties: &armpostgresql.DatabaseProperties{ - Charset: to.StringPtr(""), - Collation: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DatabasesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseDelete.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewDatabasesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseGet.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewDatabasesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DatabasesClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/DatabaseListByServer.json -func ExampleDatabasesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewDatabasesClient("", cred, nil) - res, err := client.ListByServer(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DatabasesClientListByServerResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_firewallrules_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_firewallrules_client_test.go deleted file mode 100644 index 2220768863c1..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_firewallrules_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewFirewallRulesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.FirewallRule{ - Properties: &armpostgresql.FirewallRuleProperties{ - EndIPAddress: to.StringPtr(""), - StartIPAddress: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.FirewallRulesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewFirewallRulesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewFirewallRulesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.FirewallRulesClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/FirewallRuleListByServer.json -func ExampleFirewallRulesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewFirewallRulesClient("", cred, nil) - res, err := client.ListByServer(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.FirewallRulesClientListByServerResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_locationbasedperformancetier_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_locationbasedperformancetier_client_test.go deleted file mode 100644 index 7f9a33dfbda2..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_locationbasedperformancetier_client_test.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByLocation.json -func ExampleLocationBasedPerformanceTierClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewLocationBasedPerformanceTierClient("", cred, nil) - res, err := client.List(ctx, - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.LocationBasedPerformanceTierClientListResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_logfiles_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_logfiles_client_test.go deleted file mode 100644 index 2aa9f68d089e..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_logfiles_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/LogFileListByServer.json -func ExampleLogFilesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewLogFilesClient("", cred, nil) - res, err := client.ListByServer(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.LogFilesClientListByServerResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_operations_client_test.go deleted file mode 100644 index 2f405f4b822b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/OperationList.json -func ExampleOperationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewOperationsClient(cred, nil) - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OperationsClientListResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index c95e2ba3081f..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateEndpointConnectionsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateEndpointConnectionsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.PrivateEndpointConnection{ - Properties: &armpostgresql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armpostgresql.PrivateLinkServiceConnectionStateProperty{ - Description: to.StringPtr(""), - Status: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateEndpointConnectionsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionUpdateTags.json -func ExamplePrivateEndpointConnectionsClient_BeginUpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateEndpointConnectionsClient("", cred, nil) - poller, err := client.BeginUpdateTags(ctx, - "", - "", - "", - armpostgresql.TagsObject{ - Tags: map[string]*string{ - "key1": to.StringPtr("val1"), - "key2": to.StringPtr("val2"), - "key3": to.StringPtr("val3"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientUpdateTagsResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateEndpointConnectionsClient("", cred, nil) - pager := client.ListByServer("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index c61236014458..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateLinkResourcesClient("", cred, nil) - pager := client.ListByServer("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2018-06-01/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewPrivateLinkResourcesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.PrivateLinkResourcesClientGetResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_recoverableservers_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_recoverableservers_client_test.go deleted file mode 100644 index 6723e1348573..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_recoverableservers_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/RecoverableServersGet.json -func ExampleRecoverableServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewRecoverableServersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.RecoverableServersClientGetResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_replicas_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_replicas_client_test.go deleted file mode 100644 index bd5fe972823b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_replicas_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ReplicasListByServer.json -func ExampleReplicasClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewReplicasClient("", cred, nil) - res, err := client.ListByServer(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ReplicasClientListByServerResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serveradministrators_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serveradministrators_client_test.go deleted file mode 100644 index 6de1139cdfc4..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serveradministrators_client_test.go +++ /dev/null @@ -1,107 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminGet.json -func ExampleServerAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerAdministratorsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerAdministratorsClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminCreateUpdate.json -func ExampleServerAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerAdministratorsClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armpostgresql.ServerAdministratorResource{ - Properties: &armpostgresql.ServerAdministratorProperties{ - AdministratorType: to.StringPtr(""), - Login: to.StringPtr(""), - Sid: to.StringPtr(""), - TenantID: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerAdministratorsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminDelete.json -func ExampleServerAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerAdministratorsClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerAdminList.json -func ExampleServerAdministratorsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerAdministratorsClient("", cred, nil) - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerAdministratorsClientListResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverbasedperformancetier_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverbasedperformancetier_client_test.go deleted file mode 100644 index e6b3e232ef5b..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverbasedperformancetier_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/PerformanceTiersListByServer.json -func ExampleServerBasedPerformanceTierClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerBasedPerformanceTierClient("", cred, nil) - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerBasedPerformanceTierClientListResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverkeys_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverkeys_client_test.go deleted file mode 100644 index 4cabc3da15eb..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverkeys_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyList.json -func ExampleServerKeysClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerKeysClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerKeysClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerKeysClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerKeysClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.ServerKey{ - Properties: &armpostgresql.ServerKeyProperties{ - ServerKeyType: armpostgresql.ServerKeyType("AzureKeyVault").ToPtr(), - URI: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerKeysClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2020-01-01/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerKeysClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverparameters_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverparameters_client_test.go deleted file mode 100644 index 0e52df990e83..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serverparameters_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ConfigurationsUpdateByServer.json -func ExampleServerParametersClient_BeginListUpdateConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerParametersClient("", cred, nil) - poller, err := client.BeginListUpdateConfigurations(ctx, - "", - "", - armpostgresql.ConfigurationListResult{}, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerParametersClientListUpdateConfigurationsResult) -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_servers_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_servers_client_test.go deleted file mode 100644 index 968fc6b0b5f5..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_servers_client_test.go +++ /dev/null @@ -1,181 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerCreatePointInTimeRestore.json -func ExampleServersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - poller, err := client.BeginCreate(ctx, - "", - "", - armpostgresql.ServerForCreate{ - Location: to.StringPtr(""), - Properties: &armpostgresql.ServerPropertiesForRestore{ - CreateMode: armpostgresql.CreateMode("PointInTimeRestore").ToPtr(), - RestorePointInTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-14T00:00:37.467Z"); return t }()), - SourceServerID: to.StringPtr(""), - }, - SKU: &armpostgresql.SKU{ - Name: to.StringPtr(""), - Capacity: to.Int32Ptr(2), - Family: to.StringPtr(""), - Tier: armpostgresql.SKUTier("Basic").ToPtr(), - }, - Tags: map[string]*string{ - "ElasticServer": to.StringPtr("1"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServersClientCreateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - poller, err := client.BeginUpdate(ctx, - "", - "", - armpostgresql.ServerUpdateParameters{ - Properties: &armpostgresql.ServerUpdateParametersProperties{ - AdministratorLoginPassword: to.StringPtr(""), - MinimalTLSVersion: armpostgresql.MinimalTLSVersionEnum("TLS1_2").ToPtr(), - SSLEnforcement: armpostgresql.SSLEnforcementEnumEnabled.ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServersClientUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServersClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerListByResourceGroup.json -func ExampleServersClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - res, err := client.ListByResourceGroup(ctx, - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServersClientListByResourceGroupResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerList.json -func ExampleServersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServersClientListResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerRestart.json -func ExampleServersClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServersClient("", cred, nil) - poller, err := client.BeginRestart(ctx, - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serversecurityalertpolicies_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serversecurityalertpolicies_client_test.go deleted file mode 100644 index dc34e433f791..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_serversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,101 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerSecurityAlertPoliciesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - armpostgresql.SecurityAlertPolicyName("Default"), - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerSecurityAlertPoliciesClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerSecurityAlertPoliciesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - armpostgresql.SecurityAlertPolicyName("Default"), - armpostgresql.ServerSecurityAlertPolicy{ - Properties: &armpostgresql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.StringPtr("Access_Anomaly"), - to.StringPtr("Usage_Anomaly")}, - EmailAccountAdmins: to.BoolPtr(true), - EmailAddresses: []*string{ - to.StringPtr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Int32Ptr(5), - State: armpostgresql.ServerSecurityAlertPolicyStateEnabled.ToPtr(), - StorageAccountAccessKey: to.StringPtr(""), - StorageEndpoint: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ServerSecurityAlertPoliciesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewServerSecurityAlertPoliciesClient("", cred, nil) - pager := client.ListByServer("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_virtualnetworkrules_client_test.go b/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_virtualnetworkrules_client_test.go deleted file mode 100644 index 9e1b360c39a1..000000000000 --- a/sdk/resourcemanager/postgresql/armpostgresql/ze_generated_example_virtualnetworkrules_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// 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 armpostgresql_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/postgresql/armpostgresql" -) - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewVirtualNetworkRulesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.VirtualNetworkRulesClientGetResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewVirtualNetworkRulesClient("", cred, nil) - poller, err := client.BeginCreateOrUpdate(ctx, - "", - "", - "", - armpostgresql.VirtualNetworkRule{ - Properties: &armpostgresql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.BoolPtr(false), - VirtualNetworkSubnetID: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - res, err := poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.VirtualNetworkRulesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewVirtualNetworkRulesClient("", cred, nil) - poller, err := client.BeginDelete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - _, err = poller.PollUntilDone(ctx, 30*time.Second) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2017-12-01/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armpostgresql.NewVirtualNetworkRulesClient("", cred, nil) - pager := client.ListByServer("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_checknameavailability_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_checknameavailability_client.go index cba91ea6a547..8008b41a6f33 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_checknameavailability_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_checknameavailability_client.go @@ -34,17 +34,17 @@ type CheckNameAvailabilityClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewCheckNameAvailabilityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *CheckNameAvailabilityClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &CheckNameAvailabilityClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_configurations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_configurations_client.go index 3e70157f598a..7524303361ce 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_configurations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_configurations_client.go @@ -34,17 +34,17 @@ type ConfigurationsClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ConfigurationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ConfigurationsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_constants.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_constants.go index 39b76cc658b1..df672f83b930 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_constants.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_constants.go @@ -10,7 +10,7 @@ package armpostgresql const ( moduleName = "armpostgresql" - moduleVersion = "v0.3.1" + moduleVersion = "v0.4.0" ) // CreateMode - The mode to create a new server. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_databases_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_databases_client.go index 76d25b412e6b..cc0715236c6c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_databases_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_databases_client.go @@ -34,17 +34,17 @@ type DatabasesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DatabasesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &DatabasesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_firewallrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_firewallrules_client.go index 5224030a0033..777b38fce0ae 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_firewallrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_firewallrules_client.go @@ -34,17 +34,17 @@ type FirewallRulesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *FirewallRulesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &FirewallRulesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_locationbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_locationbasedperformancetier_client.go index cbc2373c862f..fe907c3860b9 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_locationbasedperformancetier_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_locationbasedperformancetier_client.go @@ -34,17 +34,17 @@ type LocationBasedPerformanceTierClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewLocationBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LocationBasedPerformanceTierClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &LocationBasedPerformanceTierClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_logfiles_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_logfiles_client.go index fde0e0384511..0280e6e73579 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_logfiles_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_logfiles_client.go @@ -34,17 +34,17 @@ type LogFilesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewLogFilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *LogFilesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &LogFilesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_models.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_models.go index 48e7bcc63218..f0ecc27341e1 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_models.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_models.go @@ -21,13 +21,6 @@ type CheckNameAvailabilityClientExecuteOptions struct { // placeholder for future optional parameters } -// CloudError - An error response from the Batch service. -type CloudError struct { - // Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - // the OData error response format.) - Error *ErrorResponse `json:"error,omitempty"` -} - // Configuration - Represents a Configuration. type Configuration struct { // The properties of a configuration. @@ -151,45 +144,6 @@ type DatabasesClientListByServerOptions struct { // placeholder for future optional parameters } -// ErrorAdditionalInfo - The resource management error additional info. -type ErrorAdditionalInfo struct { - // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` - - // READ-ONLY; The additional info type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.) -type ErrorResponse struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` - - // READ-ONLY; The error code. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; The error details. - Details []*ErrorResponse `json:"details,omitempty" azure:"ro"` - - // READ-ONLY; The error message. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; The error target. - Target *string `json:"target,omitempty" azure:"ro"` -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - // FirewallRule - Represents a server firewall rule. type FirewallRule struct { // REQUIRED; The properties of a firewall rule. @@ -381,7 +335,7 @@ type Operation struct { Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"` // READ-ONLY; Additional descriptions for the operation. - Properties map[string]map[string]interface{} `json:"properties,omitempty" azure:"ro"` + Properties map[string]interface{} `json:"properties,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type Operation. diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_operations_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_operations_client.go index 082711edafca..fa6e6fa97745 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_operations_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_operations_client.go @@ -29,16 +29,16 @@ type OperationsClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &OperationsClient{ - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privateendpointconnections_client.go index becd6f8471f4..c999ffa0ee89 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privateendpointconnections_client.go @@ -34,17 +34,17 @@ type PrivateEndpointConnectionsClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateEndpointConnectionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &PrivateEndpointConnectionsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privatelinkresources_client.go index 73c3de8e430a..3c6f14ee3ded 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_privatelinkresources_client.go @@ -34,17 +34,17 @@ type PrivateLinkResourcesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateLinkResourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &PrivateLinkResourcesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_recoverableservers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_recoverableservers_client.go index 6879ea6a215c..020d436462e7 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_recoverableservers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_recoverableservers_client.go @@ -34,17 +34,17 @@ type RecoverableServersClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewRecoverableServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RecoverableServersClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &RecoverableServersClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_replicas_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_replicas_client.go index b9fe30492982..06c2f6560139 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_replicas_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_replicas_client.go @@ -34,17 +34,17 @@ type ReplicasClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ReplicasClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ReplicasClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serveradministrators_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serveradministrators_client.go index 329a4133a099..40836ed94378 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serveradministrators_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serveradministrators_client.go @@ -34,17 +34,17 @@ type ServerAdministratorsClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServerAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerAdministratorsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServerAdministratorsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverbasedperformancetier_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverbasedperformancetier_client.go index 99b4fc136460..d480881dcf9c 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverbasedperformancetier_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverbasedperformancetier_client.go @@ -34,17 +34,17 @@ type ServerBasedPerformanceTierClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServerBasedPerformanceTierClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerBasedPerformanceTierClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServerBasedPerformanceTierClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverkeys_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverkeys_client.go index 2f3999a971c2..402347682058 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverkeys_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverkeys_client.go @@ -34,17 +34,17 @@ type ServerKeysClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerKeysClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServerKeysClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverparameters_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverparameters_client.go index dd4431f15518..ea0f62191747 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverparameters_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serverparameters_client.go @@ -34,17 +34,17 @@ type ServerParametersClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServerParametersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerParametersClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServerParametersClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_servers_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_servers_client.go index 0a645ab8e63f..e69e6b2d8738 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_servers_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_servers_client.go @@ -34,17 +34,17 @@ type ServersClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServersClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServersClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serversecurityalertpolicies_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serversecurityalertpolicies_client.go index c685ac3dd6c1..4afe4fe5648b 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_serversecurityalertpolicies_client.go @@ -34,17 +34,17 @@ type ServerSecurityAlertPoliciesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServerSecurityAlertPoliciesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &ServerSecurityAlertPoliciesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client } diff --git a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_virtualnetworkrules_client.go b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_virtualnetworkrules_client.go index bd81909c68fa..0cc9932ecadd 100644 --- a/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_virtualnetworkrules_client.go +++ b/sdk/resourcemanager/postgresql/armpostgresql/zz_generated_virtualnetworkrules_client.go @@ -34,17 +34,17 @@ type VirtualNetworkRulesClient struct { // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *VirtualNetworkRulesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := options.Endpoint + if len(ep) == 0 { + ep = arm.AzurePublicCloud } client := &VirtualNetworkRulesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: string(ep), + pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), } return client }