diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md b/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md index 92a5deaaec9b..09516b2bdfc2 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 0.5.0 (2022-05-16) +### Breaking Changes + +- Type of `Workbook.Kind` has been changed from `*Kind` to `*WorkbookSharedTypeKind` +- Type of `WorkbookUpdateParameters.Kind` has been changed from `*SharedTypeKind` to `*WorkbookUpdateSharedTypeKind` +- Type of `WorkbookResource.Kind` has been changed from `*Kind` to `*WorkbookSharedTypeKind` +- Const `SharedTypeKindShared` has been removed +- Const `SharedTypeKindUser` has been removed +- Function `ComponentAvailableFeatures.MarshalJSON` has been removed +- Function `InnerError.MarshalJSON` has been removed +- Function `OperationsListResult.MarshalJSON` has been removed +- Function `InnerErrorTrace.MarshalJSON` has been removed +- Function `MyWorkbooksListResult.MarshalJSON` has been removed +- Function `WorkbookTemplateErrorBody.MarshalJSON` has been removed +- Function `AnnotationsListResult.MarshalJSON` has been removed +- Function `ComponentAPIKeyListResult.MarshalJSON` has been removed +- Function `ComponentFeature.MarshalJSON` has been removed +- Function `WorkbookInnerErrorTrace.MarshalJSON` has been removed +- Function `WorkbookTemplatesListResult.MarshalJSON` has been removed +- Function `WorkbooksListResult.MarshalJSON` has been removed +- Function `WorkItemConfigurationsListResult.MarshalJSON` has been removed +- Function `WebTestListResult.MarshalJSON` has been removed +- Function `OperationListResult.MarshalJSON` has been removed +- Function `ComponentAPIKey.MarshalJSON` has been removed +- Function `PossibleSharedTypeKindValues` has been removed +- Function `ComponentListResult.MarshalJSON` has been removed +- Function `WebTestLocationsListResult.MarshalJSON` has been removed + +### Features Added + +- New const `WorkbookSharedTypeKindShared` +- New const `WorkbookUpdateSharedTypeKindShared` +- New function `PossibleWorkbookUpdateSharedTypeKindValues() []WorkbookUpdateSharedTypeKind` +- New function `PossibleWorkbookSharedTypeKindValues() []WorkbookSharedTypeKind` + + ## 0.4.0 (2022-04-15) ### Breaking Changes diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md b/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md index 3b23a091ef6b..fae27c4d8e9b 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/applicationinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cc26f1d28c939bbcde00a29aa8958b3eebb10cea/specification/applicationinsights/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/applicationinsights/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/applicationinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.4.0 +module-version: 0.5.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod index a2ee0089eb6b..c901f73e7743 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect - golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum index 56d1c32628ae..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum @@ -1,53 +1,12 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 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= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_analyticsitems_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_analyticsitems_client_test.go deleted file mode 100644 index 45f869c05dcf..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_analyticsitems_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemList.json -func ExampleAnalyticsItemsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnalyticsItemsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - armapplicationinsights.ItemScopePathAnalyticsItems, - &armapplicationinsights.AnalyticsItemsClientListOptions{Scope: nil, - Type: nil, - IncludeContent: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemGet.json -func ExampleAnalyticsItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnalyticsItemsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - armapplicationinsights.ItemScopePathAnalyticsItems, - &armapplicationinsights.AnalyticsItemsClientGetOptions{ID: to.Ptr(""), - Name: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemPut.json -func ExampleAnalyticsItemsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnalyticsItemsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "", - "", - armapplicationinsights.ItemScopePathAnalyticsItems, - armapplicationinsights.ComponentAnalyticsItem{ - Content: to.Ptr(""), - Name: to.Ptr(""), - Scope: to.Ptr(armapplicationinsights.ItemScopeShared), - Type: to.Ptr(armapplicationinsights.ItemTypeQuery), - }, - &armapplicationinsights.AnalyticsItemsClientPutOptions{OverrideItem: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnalyticsItemDelete.json -func ExampleAnalyticsItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnalyticsItemsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - armapplicationinsights.ItemScopePathAnalyticsItems, - &armapplicationinsights.AnalyticsItemsClientDeleteOptions{ID: to.Ptr(""), - Name: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_annotations_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_annotations_client_test.go deleted file mode 100644 index 6696f34ab2dc..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_annotations_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsList.json -func ExampleAnnotationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnnotationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - "", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsCreate.json -func ExampleAnnotationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnnotationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "", - "", - armapplicationinsights.Annotation{ - AnnotationName: to.Ptr(""), - Category: to.Ptr(""), - EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-31T13:41:38.657Z"); return t }()), - ID: to.Ptr(""), - Properties: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsDelete.json -func ExampleAnnotationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnnotationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AnnotationsGet.json -func ExampleAnnotationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAnnotationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_apikeys_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_apikeys_client_test.go deleted file mode 100644 index 66ec6a62580a..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_apikeys_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysList.json -func ExampleAPIKeysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAPIKeysClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysCreate.json -func ExampleAPIKeysClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAPIKeysClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "", - "", - armapplicationinsights.APIKeyRequest{ - Name: to.Ptr(""), - LinkedReadProperties: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/api"), - to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/agentconfig")}, - LinkedWriteProperties: []*string{ - to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component/annotations")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysDelete.json -func ExampleAPIKeysClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAPIKeysClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/APIKeysGet.json -func ExampleAPIKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewAPIKeysClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentavailablefeatures_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentavailablefeatures_client_test.go deleted file mode 100644 index 9b16b46f7e6c..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentavailablefeatures_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/AvailableBillingFeaturesGet.json -func ExampleComponentAvailableFeaturesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentAvailableFeaturesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentcurrentbillingfeatures_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentcurrentbillingfeatures_client_test.go deleted file mode 100644 index ae1a9febfffe..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentcurrentbillingfeatures_client_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesGet.json -func ExampleComponentCurrentBillingFeaturesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentCurrentBillingFeaturesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/CurrentBillingFeaturesUpdate.json -func ExampleComponentCurrentBillingFeaturesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentCurrentBillingFeaturesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - armapplicationinsights.ComponentBillingFeatures{ - CurrentBillingFeatures: []*string{ - to.Ptr("Basic"), - to.Ptr("Application Insights Enterprise")}, - DataVolumeCap: &armapplicationinsights.ComponentDataVolumeCap{ - Cap: to.Ptr[float32](100), - StopSendNotificationWhenHitCap: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentfeaturecapabilities_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentfeaturecapabilities_client_test.go deleted file mode 100644 index fa0b0ffe79f1..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentfeaturecapabilities_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FeatureCapabilitiesGet.json -func ExampleComponentFeatureCapabilitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentFeatureCapabilitiesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentlinkedstorageaccounts_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentlinkedstorageaccounts_client_test.go deleted file mode 100644 index 0926a6d29793..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentlinkedstorageaccounts_client_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsGet.json -func ExampleComponentLinkedStorageAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentLinkedStorageAccountsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - armapplicationinsights.StorageTypeServiceProfiler, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsCreateAndUpdate.json -func ExampleComponentLinkedStorageAccountsClient_CreateAndUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentLinkedStorageAccountsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateAndUpdate(ctx, - "", - "", - armapplicationinsights.StorageTypeServiceProfiler, - armapplicationinsights.ComponentLinkedStorageAccounts{ - Properties: &armapplicationinsights.LinkedStorageAccountsProperties{ - LinkedStorageAccount: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsUpdate.json -func ExampleComponentLinkedStorageAccountsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentLinkedStorageAccountsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - armapplicationinsights.StorageTypeServiceProfiler, - armapplicationinsights.ComponentLinkedStorageAccountsPatch{ - Properties: &armapplicationinsights.LinkedStorageAccountsProperties{ - LinkedStorageAccount: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/preview/2020-03-01-preview/examples/ComponentLinkedStorageAccountsDelete.json -func ExampleComponentLinkedStorageAccountsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentLinkedStorageAccountsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - armapplicationinsights.StorageTypeServiceProfiler, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentquotastatus_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentquotastatus_client_test.go deleted file mode 100644 index f4f1c0153865..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_componentquotastatus_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/QuotaStatusGet.json -func ExampleComponentQuotaStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentQuotaStatusClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_components_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_components_client_test.go deleted file mode 100644 index beb257d556ce..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_components_client_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsList.json -func ExampleComponentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsListByResourceGroup.json -func ExampleComponentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsDelete.json -func ExampleComponentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsGet.json -func ExampleComponentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsCreate.json -func ExampleComponentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armapplicationinsights.Component{ - Location: to.Ptr(""), - Kind: to.Ptr(""), - Properties: &armapplicationinsights.ComponentProperties{ - ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb), - FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield), - RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest), - WorkspaceResourceID: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsUpdateTagsOnly.json -func ExampleComponentsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "", - "", - armapplicationinsights.TagsResource{ - Tags: map[string]*string{ - "ApplicationGatewayType": to.Ptr("Internal-Only"), - "BillingEntity": to.Ptr("Self"), - "Color": to.Ptr("AzureBlue"), - "CustomField_01": to.Ptr("Custom text in some random field named randomly"), - "NodeType": to.Ptr("Edge"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsPurge.json -func ExampleComponentsClient_Purge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Purge(ctx, - "", - "", - armapplicationinsights.ComponentPurgeBody{ - Filters: []*armapplicationinsights.ComponentPurgeBodyFilters{ - { - Column: to.Ptr(""), - Operator: to.Ptr(""), - Value: "2017-09-01T00:00:00", - }}, - Table: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-02-02/examples/ComponentsPurgeStatus.json -func ExampleComponentsClient_GetPurgeStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewComponentsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPurgeStatus(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_exportconfigurations_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_exportconfigurations_client_test.go deleted file mode 100644 index fc9156cc1412..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_exportconfigurations_client_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsList.json -func ExampleExportConfigurationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewExportConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationsPost.json -func ExampleExportConfigurationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewExportConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "", - "", - armapplicationinsights.ComponentExportRequest{ - DestinationAccountID: to.Ptr(""), - DestinationAddress: to.Ptr(""), - DestinationStorageLocationID: to.Ptr(""), - DestinationStorageSubscriptionID: to.Ptr(""), - DestinationType: to.Ptr(""), - IsEnabled: to.Ptr(""), - NotificationQueueEnabled: to.Ptr(""), - NotificationQueueURI: to.Ptr(""), - RecordTypes: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationDelete.json -func ExampleExportConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewExportConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationGet.json -func ExampleExportConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewExportConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ExportConfigurationUpdate.json -func ExampleExportConfigurationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewExportConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - "", - armapplicationinsights.ComponentExportRequest{ - DestinationAccountID: to.Ptr(""), - DestinationAddress: to.Ptr(""), - DestinationStorageLocationID: to.Ptr(""), - DestinationStorageSubscriptionID: to.Ptr(""), - DestinationType: to.Ptr(""), - IsEnabled: to.Ptr(""), - NotificationQueueEnabled: to.Ptr(""), - NotificationQueueURI: to.Ptr(""), - RecordTypes: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_favorites_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_favorites_client_test.go deleted file mode 100644 index af465d39fa62..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_favorites_client_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoritesList.json -func ExampleFavoritesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewFavoritesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - &armapplicationinsights.FavoritesClientListOptions{FavoriteType: nil, - SourceType: nil, - CanFetchContent: nil, - Tags: []string{}, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteGet.json -func ExampleFavoritesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewFavoritesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteAdd.json -func ExampleFavoritesClient_Add() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewFavoritesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Add(ctx, - "", - "", - "", - armapplicationinsights.ComponentFavorite{ - Config: to.Ptr(""), - FavoriteID: to.Ptr(""), - FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared), - IsGeneratedFromTemplate: to.Ptr(false), - Name: to.Ptr(""), - Tags: []*string{ - to.Ptr("TagSample01"), - to.Ptr("TagSample02")}, - Version: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteUpdate.json -func ExampleFavoritesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewFavoritesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - "", - armapplicationinsights.ComponentFavorite{ - Config: to.Ptr(""), - FavoriteID: to.Ptr(""), - FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared), - IsGeneratedFromTemplate: to.Ptr(false), - Name: to.Ptr(""), - Tags: []*string{ - to.Ptr("TagSample01"), - to.Ptr("TagSample02"), - to.Ptr("TagSample03")}, - TimeModified: to.Ptr(""), - Version: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/FavoriteDelete.json -func ExampleFavoritesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewFavoritesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_livetoken_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_livetoken_client_test.go deleted file mode 100644 index 9779c24eb7e9..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_livetoken_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-10-14/examples/LiveTokenGet.json -func ExampleLiveTokenClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewLiveTokenClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_myworkbooks_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_myworkbooks_client_test.go deleted file mode 100644 index 3f6c3c9cb427..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_myworkbooks_client_test.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json -func ExampleMyWorkbooksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - armapplicationinsights.CategoryTypeWorkbook, - &armapplicationinsights.MyWorkbooksClientListByResourceGroupOptions{Tags: []string{}, - SourceID: nil, - CanFetchContent: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbooksList.json -func ExampleMyWorkbooksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(armapplicationinsights.CategoryTypeWorkbook, - &armapplicationinsights.MyWorkbooksClientListBySubscriptionOptions{Tags: []string{}, - CanFetchContent: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookGet.json -func ExampleMyWorkbooksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookDelete.json -func ExampleMyWorkbooksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookAdd.json -func ExampleMyWorkbooksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armapplicationinsights.MyWorkbook{ - Name: to.Ptr(""), - ID: to.Ptr(""), - Location: to.Ptr(""), - Tags: map[string]*string{ - "0": to.Ptr("TagSample01"), - "1": to.Ptr("TagSample02"), - }, - Kind: to.Ptr(armapplicationinsights.KindUser), - Properties: &armapplicationinsights.MyWorkbookProperties{ - Category: to.Ptr(""), - DisplayName: to.Ptr(""), - SerializedData: to.Ptr(""), - SourceID: to.Ptr(""), - }, - }, - &armapplicationinsights.MyWorkbooksClientCreateOrUpdateOptions{SourceID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-03-08/examples/MyWorkbookUpdate.json -func ExampleMyWorkbooksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewMyWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "", - "", - armapplicationinsights.MyWorkbook{ - Name: to.Ptr(""), - Location: to.Ptr(""), - Tags: map[string]*string{ - "0": to.Ptr("TagSample01"), - "1": to.Ptr("TagSample02"), - }, - Kind: to.Ptr(armapplicationinsights.KindUser), - Properties: &armapplicationinsights.MyWorkbookProperties{ - Category: to.Ptr(""), - DisplayName: to.Ptr(""), - SerializedData: to.Ptr(""), - SourceID: to.Ptr(""), - Version: to.Ptr(""), - }, - }, - &armapplicationinsights.MyWorkbooksClientUpdateOptions{SourceID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_proactivedetectionconfigurations_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_proactivedetectionconfigurations_client_test.go deleted file mode 100644 index 6da319e213c6..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_proactivedetectionconfigurations_client_test.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationsList.json -func ExampleProactiveDetectionConfigurationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewProactiveDetectionConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationGet.json -func ExampleProactiveDetectionConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewProactiveDetectionConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/ProactiveDetectionConfigurationUpdate.json -func ExampleProactiveDetectionConfigurationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewProactiveDetectionConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - "", - armapplicationinsights.ComponentProactiveDetectionConfiguration{ - CustomEmails: []*string{ - to.Ptr("foo@microsoft.com"), - to.Ptr("foo2@microsoft.com")}, - Enabled: to.Ptr(true), - Name: to.Ptr(""), - RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{ - Description: to.Ptr(""), - DisplayName: to.Ptr(""), - HelpURL: to.Ptr(""), - IsEnabledByDefault: to.Ptr(true), - IsHidden: to.Ptr(false), - IsInPreview: to.Ptr(false), - Name: to.Ptr(""), - SupportsEmailNotifications: to.Ptr(true), - }, - SendEmailsToSubscriptionOwners: to.Ptr(true), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtestlocations_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtestlocations_client_test.go deleted file mode 100644 index 4ff39d725085..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtestlocations_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestLocationsList.json -func ExampleWebTestLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestLocationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtests_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtests_client_test.go deleted file mode 100644 index d7f716b45a24..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtests_client_test.go +++ /dev/null @@ -1,212 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByResourceGroup.json -func ExampleWebTestsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestGet.json -func ExampleWebTestsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestCreate.json -func ExampleWebTestsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armapplicationinsights.WebTest{ - Location: to.Ptr(""), - Kind: to.Ptr(armapplicationinsights.WebTestKindPing), - Properties: &armapplicationinsights.WebTestProperties{ - Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{ - WebTest: to.Ptr(""), - }, - Description: to.Ptr(""), - Enabled: to.Ptr(true), - Frequency: to.Ptr[int32](900), - WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing), - Locations: []*armapplicationinsights.WebTestGeolocation{ - { - Location: to.Ptr(""), - }}, - WebTestName: to.Ptr(""), - RetryEnabled: to.Ptr(true), - SyntheticMonitorID: to.Ptr(""), - Timeout: to.Ptr[int32](120), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestUpdateTagsOnly.json -func ExampleWebTestsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "", - "", - armapplicationinsights.TagsResource{ - Tags: map[string]*string{ - "Color": to.Ptr("AzureBlue"), - "CustomField-01": to.Ptr("This is a random value"), - "SystemType": to.Ptr("A08"), - "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"), - "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/mytestwebapp": to.Ptr("Resource"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestDelete.json -func ExampleWebTestsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestList.json -func ExampleWebTestsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WebTestListByComponent.json -func ExampleWebTestsClient_NewListByComponentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWebTestsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByComponentPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooks_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooks_client_test.go deleted file mode 100644 index b34228c41978..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooks_client_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList2.json -func ExampleWorkbooksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(armapplicationinsights.CategoryTypeWorkbook, - &armapplicationinsights.WorkbooksClientListBySubscriptionOptions{Tags: []string{}, - CanFetchContent: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbooksList.json -func ExampleWorkbooksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - armapplicationinsights.CategoryTypeWorkbook, - &armapplicationinsights.WorkbooksClientListByResourceGroupOptions{Tags: []string{}, - SourceID: to.Ptr(""), - CanFetchContent: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookGet.json -func ExampleWorkbooksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - &armapplicationinsights.WorkbooksClientGetOptions{CanFetchContent: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookDelete.json -func ExampleWorkbooksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookAdd.json -func ExampleWorkbooksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armapplicationinsights.Workbook{ - Location: to.Ptr(""), - Tags: map[string]*string{ - "TagSample01": to.Ptr("sample01"), - "TagSample02": to.Ptr("sample02"), - }, - Kind: to.Ptr(armapplicationinsights.KindShared), - Properties: &armapplicationinsights.WorkbookProperties{ - Description: to.Ptr(""), - Category: to.Ptr(""), - DisplayName: to.Ptr(""), - SerializedData: to.Ptr(""), - }, - }, - &armapplicationinsights.WorkbooksClientCreateOrUpdateOptions{SourceID: to.Ptr("")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookManagedUpdate.json -func ExampleWorkbooksClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "", - "", - &armapplicationinsights.WorkbooksClientUpdateOptions{SourceID: to.Ptr(""), - WorkbookUpdateParameters: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionsList.json -func ExampleWorkbooksClient_NewRevisionsListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewRevisionsListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2021-08-01/examples/WorkbookRevisionGet.json -func ExampleWorkbooksClient_RevisionGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbooksClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RevisionGet(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooktemplates_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooktemplates_client_test.go deleted file mode 100644 index 9f7ce690c6d8..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooktemplates_client_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplatesList.json -func ExampleWorkbookTemplatesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbookTemplatesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateGet.json -func ExampleWorkbookTemplatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbookTemplatesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateDelete.json -func ExampleWorkbookTemplatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbookTemplatesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateAdd.json -func ExampleWorkbookTemplatesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbookTemplatesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "", - "", - armapplicationinsights.WorkbookTemplate{ - Location: to.Ptr(""), - Properties: &armapplicationinsights.WorkbookTemplateProperties{ - Author: to.Ptr(""), - Galleries: []*armapplicationinsights.WorkbookTemplateGallery{ - { - Name: to.Ptr(""), - Type: to.Ptr(""), - Category: to.Ptr(""), - Order: to.Ptr[int32](100), - ResourceType: to.Ptr(""), - }}, - Priority: to.Ptr[int32](1), - TemplateData: map[string]interface{}{ - "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json", - "items": []interface{}{ - map[string]interface{}{ - "name": "text - 2", - "type": float64(1), - "content": map[string]interface{}{ - "json": "## New workbook\n---\n\nWelcome to your new workbook. This area will display text formatted as markdown.\n\n\nWe've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.", - }, - }, - map[string]interface{}{ - "name": "query - 2", - "type": float64(3), - "content": map[string]interface{}{ - "exportToExcelOptions": "visible", - "query": "union withsource=TableName *\n| summarize Count=count() by TableName\n| render barchart", - "queryType": float64(0), - "resourceType": "microsoft.operationalinsights/workspaces", - "size": float64(1), - "version": "KqlItem/1.0", - }, - }, - }, - "styleSettings": map[string]interface{}{}, - "version": "Notebook/1.0", - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2020-11-20/examples/WorkbookTemplateUpdate.json -func ExampleWorkbookTemplatesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkbookTemplatesClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "", - "", - &armapplicationinsights.WorkbookTemplatesClientUpdateOptions{WorkbookTemplateUpdateParameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workitemconfigurations_client_test.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workitemconfigurations_client_test.go deleted file mode 100644 index 015e2a8d6c36..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workitemconfigurations_client_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapplicationinsights_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/applicationinsights/armapplicationinsights" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigsGet.json -func ExampleWorkItemConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("", - "", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - return - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigCreate.json -func ExampleWorkItemConfigurationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "", - "", - armapplicationinsights.WorkItemCreateConfiguration{ - ConnectorDataConfiguration: to.Ptr(""), - ConnectorID: to.Ptr(""), - ValidateOnly: to.Ptr(true), - WorkItemProperties: map[string]*string{ - "0": to.Ptr("[object Object]"), - "1": to.Ptr("[object Object]"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDefaultGet.json -func ExampleWorkItemConfigurationsClient_GetDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefault(ctx, - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigDelete.json -func ExampleWorkItemConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigGet.json -func ExampleWorkItemConfigurationsClient_GetItem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetItem(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2015-05-01/examples/WorkItemConfigUpdate.json -func ExampleWorkItemConfigurationsClient_UpdateItem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapplicationinsights.NewWorkItemConfigurationsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateItem(ctx, - "", - "", - "", - armapplicationinsights.WorkItemCreateConfiguration{ - ConnectorDataConfiguration: to.Ptr(""), - ConnectorID: to.Ptr(""), - ValidateOnly: to.Ptr(true), - WorkItemProperties: map[string]*string{ - "0": to.Ptr("[object Object]"), - "1": to.Ptr("[object Object]"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go index 70cadc2e618a..3c34910b7c54 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go @@ -39,7 +39,7 @@ func NewAnalyticsItemsClient(subscriptionID string, credential azcore.TokenCrede if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewAnalyticsItemsClient(subscriptionID string, credential azcore.TokenCrede // Delete - Deletes a specific Analytics Items defined within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access @@ -114,6 +115,7 @@ func (client *AnalyticsItemsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a specific Analytics Items defined within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access @@ -166,7 +168,7 @@ func (client *AnalyticsItemsClient) getCreateRequest(ctx context.Context, resour reqQP.Set("name", *options.Name) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -181,6 +183,7 @@ func (client *AnalyticsItemsClient) getHandleResponse(resp *http.Response) (Anal // List - Gets a list of Analytics Items defined within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access @@ -236,7 +239,7 @@ func (client *AnalyticsItemsClient) listCreateRequest(ctx context.Context, resou reqQP.Set("includeContent", strconv.FormatBool(*options.IncludeContent)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -251,6 +254,7 @@ func (client *AnalyticsItemsClient) listHandleResponse(resp *http.Response) (Ana // Put - Adds or Updates a specific Analytics Item within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // scopePath - Enum indicating if this item definition is owned by a specific user or is shared between all users with access @@ -301,7 +305,7 @@ func (client *AnalyticsItemsClient) putCreateRequest(ctx context.Context, resour reqQP.Set("overrideItem", strconv.FormatBool(*options.OverrideItem)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, itemProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go index 6ccefb469195..6056851ed51e 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go @@ -38,7 +38,7 @@ func NewAnnotationsClient(subscriptionID string, credential azcore.TokenCredenti if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewAnnotationsClient(subscriptionID string, credential azcore.TokenCredenti // Create - Create an Annotation of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // annotationProperties - Properties that need to be specified to create an annotation of a Application Insights component. @@ -97,7 +98,7 @@ func (client *AnnotationsClient) createCreateRequest(ctx context.Context, resour reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, annotationProperties) } @@ -112,6 +113,7 @@ func (client *AnnotationsClient) createHandleResponse(resp *http.Response) (Anno // Delete - Delete an Annotation of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // annotationID - The unique annotation ID. This is unique within a Application Insights component. @@ -162,6 +164,7 @@ func (client *AnnotationsClient) deleteCreateRequest(ctx context.Context, resour // Get - Get the annotation for given id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // annotationID - The unique annotation ID. This is unique within a Application Insights component. @@ -207,7 +210,7 @@ func (client *AnnotationsClient) getCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -222,13 +225,14 @@ func (client *AnnotationsClient) getHandleResponse(resp *http.Response) (Annotat // NewListPager - Gets the list of annotations for a component for given time range // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // start - The start time to query from for annotations, cannot be older than 90 days from current date. // end - The end time to query for annotations. // options - AnnotationsClientListOptions contains the optional parameters for the AnnotationsClient.List method. func (client *AnnotationsClient) NewListPager(resourceGroupName string, resourceName string, start string, end string, options *AnnotationsClientListOptions) *runtime.Pager[AnnotationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[AnnotationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[AnnotationsClientListResponse]{ More: func(page AnnotationsClientListResponse) bool { return false }, @@ -273,7 +277,7 @@ func (client *AnnotationsClient) listCreateRequest(ctx context.Context, resource reqQP.Set("start", start) reqQP.Set("end", end) req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go index abbf49239248..bd1b7e469633 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go @@ -38,7 +38,7 @@ func NewAPIKeysClient(subscriptionID string, credential azcore.TokenCredential, if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewAPIKeysClient(subscriptionID string, credential azcore.TokenCredential, // Create - Create an API Key of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // apiKeyProperties - Properties that need to be specified to create an API key of a Application Insights component. @@ -97,7 +98,7 @@ func (client *APIKeysClient) createCreateRequest(ctx context.Context, resourceGr reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, apiKeyProperties) } @@ -112,6 +113,7 @@ func (client *APIKeysClient) createHandleResponse(resp *http.Response) (APIKeysC // Delete - Delete an API Key of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // keyID - The API Key ID. This is unique within a Application Insights component. @@ -157,7 +159,7 @@ func (client *APIKeysClient) deleteCreateRequest(ctx context.Context, resourceGr reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -172,6 +174,7 @@ func (client *APIKeysClient) deleteHandleResponse(resp *http.Response) (APIKeysC // Get - Get the API Key for this key id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // keyID - The API Key ID. This is unique within a Application Insights component. @@ -217,7 +220,7 @@ func (client *APIKeysClient) getCreateRequest(ctx context.Context, resourceGroup reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -232,11 +235,12 @@ func (client *APIKeysClient) getHandleResponse(resp *http.Response) (APIKeysClie // NewListPager - Gets a list of API keys of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - APIKeysClientListOptions contains the optional parameters for the APIKeysClient.List method. func (client *APIKeysClient) NewListPager(resourceGroupName string, resourceName string, options *APIKeysClientListOptions) *runtime.Pager[APIKeysClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[APIKeysClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[APIKeysClientListResponse]{ More: func(page APIKeysClientListResponse) bool { return false }, @@ -279,7 +283,7 @@ func (client *APIKeysClient) listCreateRequest(ctx context.Context, resourceGrou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go index 4e641349de9c..4191b2e0317c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go @@ -38,7 +38,7 @@ func NewComponentAvailableFeaturesClient(subscriptionID string, credential azcor if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewComponentAvailableFeaturesClient(subscriptionID string, credential azcor // Get - Returns all available features of the application insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentAvailableFeaturesClientGetOptions contains the optional parameters for the ComponentAvailableFeaturesClient.Get @@ -97,7 +98,7 @@ func (client *ComponentAvailableFeaturesClient) getCreateRequest(ctx context.Con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go index 763aafd5984a..720762afda77 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go @@ -38,7 +38,7 @@ func NewComponentCurrentBillingFeaturesClient(subscriptionID string, credential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewComponentCurrentBillingFeaturesClient(subscriptionID string, credential // Get - Returns current billing features for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentCurrentBillingFeaturesClientGetOptions contains the optional parameters for the ComponentCurrentBillingFeaturesClient.Get @@ -97,7 +98,7 @@ func (client *ComponentCurrentBillingFeaturesClient) getCreateRequest(ctx contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -112,6 +113,7 @@ func (client *ComponentCurrentBillingFeaturesClient) getHandleResponse(resp *htt // Update - Update current billing features for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // billingFeaturesProperties - Properties that need to be specified to update billing features for an Application Insights @@ -155,7 +157,7 @@ func (client *ComponentCurrentBillingFeaturesClient) updateCreateRequest(ctx con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, billingFeaturesProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go index 7c4521835b52..cf38e9f7431b 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go @@ -38,7 +38,7 @@ func NewComponentFeatureCapabilitiesClient(subscriptionID string, credential azc if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewComponentFeatureCapabilitiesClient(subscriptionID string, credential azc // Get - Returns feature capabilities of the application insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentFeatureCapabilitiesClientGetOptions contains the optional parameters for the ComponentFeatureCapabilitiesClient.Get @@ -97,7 +98,7 @@ func (client *ComponentFeatureCapabilitiesClient) getCreateRequest(ctx context.C reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go index 0b6312bc1676..2b61b8dea873 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go @@ -38,7 +38,7 @@ func NewComponentLinkedStorageAccountsClient(subscriptionID string, credential a if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewComponentLinkedStorageAccountsClient(subscriptionID string, credential a // CreateAndUpdate - Replace current linked storage account for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-03-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // storageType - The type of the Application Insights component data source for the linked storage account. @@ -104,7 +105,7 @@ func (client *ComponentLinkedStorageAccountsClient) createAndUpdateCreateRequest reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, linkedStorageAccountsProperties) } @@ -119,6 +120,7 @@ func (client *ComponentLinkedStorageAccountsClient) createAndUpdateHandleRespons // Delete - Delete linked storage accounts for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-03-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // storageType - The type of the Application Insights component data source for the linked storage account. @@ -165,12 +167,13 @@ func (client *ComponentLinkedStorageAccountsClient) deleteCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns the current linked storage settings for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-03-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // storageType - The type of the Application Insights component data source for the linked storage account. @@ -217,7 +220,7 @@ func (client *ComponentLinkedStorageAccountsClient) getCreateRequest(ctx context reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -232,6 +235,7 @@ func (client *ComponentLinkedStorageAccountsClient) getHandleResponse(resp *http // Update - Update linked storage accounts for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-03-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // storageType - The type of the Application Insights component data source for the linked storage account. @@ -280,7 +284,7 @@ func (client *ComponentLinkedStorageAccountsClient) updateCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, linkedStorageAccountsProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go index d7c10bb71abe..0224b27d9d09 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go @@ -38,7 +38,7 @@ func NewComponentQuotaStatusClient(subscriptionID string, credential azcore.Toke if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewComponentQuotaStatusClient(subscriptionID string, credential azcore.Toke // Get - Returns daily data volume cap (quota) status for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentQuotaStatusClientGetOptions contains the optional parameters for the ComponentQuotaStatusClient.Get @@ -97,7 +98,7 @@ func (client *ComponentQuotaStatusClient) getCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go index f5470f15a1db..2a4e5bf938a6 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go @@ -38,7 +38,7 @@ func NewComponentsClient(subscriptionID string, credential azcore.TokenCredentia if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewComponentsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates (or updates) an Application Insights component. Note: You cannot specify a different value for // InstrumentationKey nor AppId in the Put operation. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // insightProperties - Properties that need to be specified to create an Application Insights component. @@ -99,7 +100,7 @@ func (client *ComponentsClient) createOrUpdateCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, insightProperties) } @@ -114,6 +115,7 @@ func (client *ComponentsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentsClientDeleteOptions contains the optional parameters for the ComponentsClient.Delete method. @@ -154,12 +156,13 @@ func (client *ComponentsClient) deleteCreateRequest(ctx context.Context, resourc reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ComponentsClientGetOptions contains the optional parameters for the ComponentsClient.Get method. @@ -200,7 +203,7 @@ func (client *ComponentsClient) getCreateRequest(ctx context.Context, resourceGr reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -215,6 +218,7 @@ func (client *ComponentsClient) getHandleResponse(resp *http.Response) (Componen // GetPurgeStatus - Get status for an ongoing purge operation. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // purgeID - In a purge status request, this is the Id of the operation the status of which is returned. @@ -261,7 +265,7 @@ func (client *ComponentsClient) getPurgeStatusCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -276,9 +280,10 @@ func (client *ComponentsClient) getPurgeStatusHandleResponse(resp *http.Response // NewListPager - Gets a list of all Application Insights components within a subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // options - ComponentsClientListOptions contains the optional parameters for the ComponentsClient.List method. func (client *ComponentsClient) NewListPager(options *ComponentsClientListOptions) *runtime.Pager[ComponentsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[ComponentsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[ComponentsClientListResponse]{ More: func(page ComponentsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -319,7 +324,7 @@ func (client *ComponentsClient) listCreateRequest(ctx context.Context, options * reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -334,11 +339,12 @@ func (client *ComponentsClient) listHandleResponse(resp *http.Response) (Compone // NewListByResourceGroupPager - Gets a list of Application Insights components within a resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ComponentsClientListByResourceGroupOptions contains the optional parameters for the ComponentsClient.ListByResourceGroup // method. func (client *ComponentsClient) NewListByResourceGroupPager(resourceGroupName string, options *ComponentsClientListByResourceGroupOptions) *runtime.Pager[ComponentsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[ComponentsClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[ComponentsClientListByResourceGroupResponse]{ More: func(page ComponentsClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -383,7 +389,7 @@ func (client *ComponentsClient) listByResourceGroupCreateRequest(ctx context.Con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -402,6 +408,7 @@ func (client *ComponentsClient) listByResourceGroupHandleResponse(resp *http.Res // user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior // to using for a purge request to verify that the results are expected. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // body - Describes the body of a request to purge data in a single table of an Application Insights component @@ -443,7 +450,7 @@ func (client *ComponentsClient) purgeCreateRequest(ctx context.Context, resource reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } @@ -458,6 +465,7 @@ func (client *ComponentsClient) purgeHandleResponse(resp *http.Response) (Compon // UpdateTags - Updates an existing component's tags. To update other fields use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-02-02 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // componentTags - Updated tag information to set into the component instance. @@ -499,7 +507,7 @@ func (client *ComponentsClient) updateTagsCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-02-02") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, componentTags) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go index 05918d40e029..b93bf41c92a3 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go @@ -10,7 +10,7 @@ package armapplicationinsights const ( moduleName = "armapplicationinsights" - moduleVersion = "v0.4.0" + moduleVersion = "v0.5.0" ) // ApplicationType - Type of application being monitored. @@ -320,22 +320,6 @@ func PossibleRequestSourceValues() []RequestSource { } } -// SharedTypeKind - The kind of workbook. Only valid value is shared. -type SharedTypeKind string - -const ( - SharedTypeKindShared SharedTypeKind = "shared" - SharedTypeKindUser SharedTypeKind = "user" -) - -// PossibleSharedTypeKindValues returns the possible values for the SharedTypeKind const type. -func PossibleSharedTypeKindValues() []SharedTypeKind { - return []SharedTypeKind{ - SharedTypeKindShared, - SharedTypeKindUser, - } -} - type StorageType string const ( @@ -364,3 +348,31 @@ func PossibleWebTestKindValues() []WebTestKind { WebTestKindMultistep, } } + +// WorkbookSharedTypeKind - The kind of workbook. Only valid value is shared. +type WorkbookSharedTypeKind string + +const ( + WorkbookSharedTypeKindShared WorkbookSharedTypeKind = "shared" +) + +// PossibleWorkbookSharedTypeKindValues returns the possible values for the WorkbookSharedTypeKind const type. +func PossibleWorkbookSharedTypeKindValues() []WorkbookSharedTypeKind { + return []WorkbookSharedTypeKind{ + WorkbookSharedTypeKindShared, + } +} + +// WorkbookUpdateSharedTypeKind - The kind of workbook. Only valid value is shared. +type WorkbookUpdateSharedTypeKind string + +const ( + WorkbookUpdateSharedTypeKindShared WorkbookUpdateSharedTypeKind = "shared" +) + +// PossibleWorkbookUpdateSharedTypeKindValues returns the possible values for the WorkbookUpdateSharedTypeKind const type. +func PossibleWorkbookUpdateSharedTypeKindValues() []WorkbookUpdateSharedTypeKind { + return []WorkbookUpdateSharedTypeKind{ + WorkbookUpdateSharedTypeKindShared, + } +} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go index 7a109e163876..123bf3e017d9 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go @@ -38,7 +38,7 @@ func NewExportConfigurationsClient(subscriptionID string, credential azcore.Toke if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewExportConfigurationsClient(subscriptionID string, credential azcore.Toke // Create - Create a Continuous Export configuration of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // exportProperties - Properties that need to be specified to create a Continuous Export configuration of a Application Insights @@ -99,7 +100,7 @@ func (client *ExportConfigurationsClient) createCreateRequest(ctx context.Contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, exportProperties) } @@ -114,6 +115,7 @@ func (client *ExportConfigurationsClient) createHandleResponse(resp *http.Respon // Delete - Delete a Continuous Export configuration of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // exportID - The Continuous Export configuration ID. This is unique within a Application Insights component. @@ -160,7 +162,7 @@ func (client *ExportConfigurationsClient) deleteCreateRequest(ctx context.Contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -175,6 +177,7 @@ func (client *ExportConfigurationsClient) deleteHandleResponse(resp *http.Respon // Get - Get the Continuous Export configuration for this export id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // exportID - The Continuous Export configuration ID. This is unique within a Application Insights component. @@ -221,7 +224,7 @@ func (client *ExportConfigurationsClient) getCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -236,6 +239,7 @@ func (client *ExportConfigurationsClient) getHandleResponse(resp *http.Response) // List - Gets a list of Continuous Export configuration of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ExportConfigurationsClientListOptions contains the optional parameters for the ExportConfigurationsClient.List @@ -277,7 +281,7 @@ func (client *ExportConfigurationsClient) listCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -292,6 +296,7 @@ func (client *ExportConfigurationsClient) listHandleResponse(resp *http.Response // Update - Update the Continuous Export configuration for this export id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // exportID - The Continuous Export configuration ID. This is unique within a Application Insights component. @@ -339,7 +344,7 @@ func (client *ExportConfigurationsClient) updateCreateRequest(ctx context.Contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, exportProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go index 7a8dfbbc5ca8..bf36bdeeaf6b 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go @@ -39,7 +39,7 @@ func NewFavoritesClient(subscriptionID string, credential azcore.TokenCredential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewFavoritesClient(subscriptionID string, credential azcore.TokenCredential // Add - Adds a new favorites to an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // favoriteID - The Id of a specific favorite defined in the Application Insights component @@ -104,7 +105,7 @@ func (client *FavoritesClient) addCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, favoriteProperties) } @@ -119,6 +120,7 @@ func (client *FavoritesClient) addHandleResponse(resp *http.Response) (Favorites // Delete - Remove a favorite that is associated to an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // favoriteID - The Id of a specific favorite defined in the Application Insights component @@ -169,6 +171,7 @@ func (client *FavoritesClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a single favorite by its FavoriteId, defined within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // favoriteID - The Id of a specific favorite defined in the Application Insights component @@ -214,7 +217,7 @@ func (client *FavoritesClient) getCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -229,6 +232,7 @@ func (client *FavoritesClient) getHandleResponse(resp *http.Response) (Favorites // List - Gets a list of favorites defined within an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - FavoritesClientListOptions contains the optional parameters for the FavoritesClient.List method. @@ -281,7 +285,7 @@ func (client *FavoritesClient) listCreateRequest(ctx context.Context, resourceGr reqQP.Set("tags", strings.Join(options.Tags, ",")) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -296,6 +300,7 @@ func (client *FavoritesClient) listHandleResponse(resp *http.Response) (Favorite // Update - Updates a favorite that has already been added to an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // favoriteID - The Id of a specific favorite defined in the Application Insights component @@ -342,7 +347,7 @@ func (client *FavoritesClient) updateCreateRequest(ctx context.Context, resource reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, favoriteProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go index 8fdf19732b96..b1fe546f329e 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go @@ -34,7 +34,7 @@ func NewLiveTokenClient(credential azcore.TokenCredential, options *arm.ClientOp if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -51,6 +51,7 @@ func NewLiveTokenClient(credential azcore.TokenCredential, options *arm.ClientOp // Get - Gets an access token for live metrics stream data. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-14 // resourceURI - The identifier of the resource. // options - LiveTokenClientGetOptions contains the optional parameters for the LiveTokenClient.Get method. func (client *LiveTokenClient) Get(ctx context.Context, resourceURI string, options *LiveTokenClientGetOptions) (LiveTokenClientGetResponse, error) { @@ -79,7 +80,7 @@ func (client *LiveTokenClient) getCreateRequest(ctx context.Context, resourceURI reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-10-14") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go index ed70a5003051..b6f1efde4a1a 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go @@ -1583,7 +1583,7 @@ type WorkItemCreateConfiguration struct { WorkItemProperties map[string]*string `json:"WorkItemProperties,omitempty"` } -// Workbook - An Application Insights workbook definition. +// Workbook - A workbook definition. type Workbook struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` @@ -1595,7 +1595,7 @@ type Workbook struct { Identity *WorkbookResourceIdentity `json:"identity,omitempty"` // The kind of workbook. Only valid value is shared. - Kind *Kind `json:"kind,omitempty"` + Kind *WorkbookSharedTypeKind `json:"kind,omitempty"` // Metadata describing a workbook for an Azure resource. Properties *WorkbookProperties `json:"properties,omitempty"` @@ -1709,7 +1709,7 @@ type WorkbookResource struct { Identity *WorkbookResourceIdentity `json:"identity,omitempty"` // The kind of workbook. Only valid value is shared. - Kind *Kind `json:"kind,omitempty"` + Kind *WorkbookSharedTypeKind `json:"kind,omitempty"` // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -1904,7 +1904,7 @@ type WorkbookTemplatesListResult struct { // WorkbookUpdateParameters - The parameters that can be provided when updating workbook properties properties. type WorkbookUpdateParameters struct { // The kind of workbook. Only valid value is shared. - Kind *SharedTypeKind `json:"kind,omitempty"` + Kind *WorkbookUpdateSharedTypeKind `json:"kind,omitempty"` // Metadata describing a workbook for an Azure resource. Properties *WorkbookPropertiesUpdateParameters `json:"properties,omitempty"` diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go index 4a11d69294b9..e83bd08bb9d1 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go @@ -10,6 +10,7 @@ package armapplicationinsights import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) @@ -39,44 +40,37 @@ func (a Annotation) MarshalJSON() ([]byte, error) { func (a *Annotation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "AnnotationName": - err = unpopulate(val, &a.AnnotationName) + err = unpopulate(val, "AnnotationName", &a.AnnotationName) delete(rawMsg, key) case "Category": - err = unpopulate(val, &a.Category) + err = unpopulate(val, "Category", &a.Category) delete(rawMsg, key) case "EventTime": - err = unpopulateTimeRFC3339(val, &a.EventTime) + err = unpopulateTimeRFC3339(val, "EventTime", &a.EventTime) delete(rawMsg, key) case "Id": - err = unpopulate(val, &a.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "Properties": - err = unpopulate(val, &a.Properties) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "RelatedAnnotation": - err = unpopulate(val, &a.RelatedAnnotation) + err = unpopulate(val, "RelatedAnnotation", &a.RelatedAnnotation) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type AnnotationsListResult. -func (a AnnotationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type Component. func (c Component) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -91,32 +85,6 @@ func (c Component) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ComponentAPIKey. -func (c ComponentAPIKey) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiKey", c.APIKey) - populate(objectMap, "createdDate", c.CreatedDate) - populate(objectMap, "id", c.ID) - populate(objectMap, "linkedReadProperties", c.LinkedReadProperties) - populate(objectMap, "linkedWriteProperties", c.LinkedWriteProperties) - populate(objectMap, "name", c.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentAPIKeyListResult. -func (c ComponentAPIKeyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentAvailableFeatures. -func (c ComponentAvailableFeatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "Result", c.Result) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ComponentBillingFeatures. func (c ComponentBillingFeatures) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -142,21 +110,6 @@ func (c ComponentFavorite) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ComponentFeature. -func (c ComponentFeature) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "Capabilities", c.Capabilities) - populate(objectMap, "FeatureName", c.FeatureName) - populate(objectMap, "IsHidden", c.IsHidden) - populate(objectMap, "IsMainFeature", c.IsMainFeature) - populate(objectMap, "MeterId", c.MeterID) - populate(objectMap, "MeterRateFrequency", c.MeterRateFrequency) - populate(objectMap, "ResouceId", c.ResouceID) - populate(objectMap, "SupportedAddonFeatures", c.SupportedAddonFeatures) - populate(objectMap, "Title", c.Title) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ComponentLinkedStorageAccountsPatch. func (c ComponentLinkedStorageAccountsPatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -164,14 +117,6 @@ func (c ComponentLinkedStorageAccountsPatch) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ComponentListResult. -func (c ComponentListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfiguration. func (c ComponentProactiveDetectionConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -219,89 +164,89 @@ func (c ComponentProperties) MarshalJSON() ([]byte, error) { func (c *ComponentProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "AppId": - err = unpopulate(val, &c.AppID) + err = unpopulate(val, "AppID", &c.AppID) delete(rawMsg, key) case "ApplicationId": - err = unpopulate(val, &c.ApplicationID) + err = unpopulate(val, "ApplicationID", &c.ApplicationID) delete(rawMsg, key) case "Application_Type": - err = unpopulate(val, &c.ApplicationType) + err = unpopulate(val, "ApplicationType", &c.ApplicationType) delete(rawMsg, key) case "ConnectionString": - err = unpopulate(val, &c.ConnectionString) + err = unpopulate(val, "ConnectionString", &c.ConnectionString) delete(rawMsg, key) case "CreationDate": - err = unpopulateTimeRFC3339(val, &c.CreationDate) + err = unpopulateTimeRFC3339(val, "CreationDate", &c.CreationDate) delete(rawMsg, key) case "DisableIpMasking": - err = unpopulate(val, &c.DisableIPMasking) + err = unpopulate(val, "DisableIPMasking", &c.DisableIPMasking) delete(rawMsg, key) case "DisableLocalAuth": - err = unpopulate(val, &c.DisableLocalAuth) + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) delete(rawMsg, key) case "Flow_Type": - err = unpopulate(val, &c.FlowType) + err = unpopulate(val, "FlowType", &c.FlowType) delete(rawMsg, key) case "ForceCustomerStorageForProfiler": - err = unpopulate(val, &c.ForceCustomerStorageForProfiler) + err = unpopulate(val, "ForceCustomerStorageForProfiler", &c.ForceCustomerStorageForProfiler) delete(rawMsg, key) case "HockeyAppId": - err = unpopulate(val, &c.HockeyAppID) + err = unpopulate(val, "HockeyAppID", &c.HockeyAppID) delete(rawMsg, key) case "HockeyAppToken": - err = unpopulate(val, &c.HockeyAppToken) + err = unpopulate(val, "HockeyAppToken", &c.HockeyAppToken) delete(rawMsg, key) case "ImmediatePurgeDataOn30Days": - err = unpopulate(val, &c.ImmediatePurgeDataOn30Days) + err = unpopulate(val, "ImmediatePurgeDataOn30Days", &c.ImmediatePurgeDataOn30Days) delete(rawMsg, key) case "IngestionMode": - err = unpopulate(val, &c.IngestionMode) + err = unpopulate(val, "IngestionMode", &c.IngestionMode) delete(rawMsg, key) case "InstrumentationKey": - err = unpopulate(val, &c.InstrumentationKey) + err = unpopulate(val, "InstrumentationKey", &c.InstrumentationKey) delete(rawMsg, key) case "LaMigrationDate": - err = unpopulateTimeRFC3339(val, &c.LaMigrationDate) + err = unpopulateTimeRFC3339(val, "LaMigrationDate", &c.LaMigrationDate) delete(rawMsg, key) case "Name": - err = unpopulate(val, &c.Name) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "PrivateLinkScopedResources": - err = unpopulate(val, &c.PrivateLinkScopedResources) + err = unpopulate(val, "PrivateLinkScopedResources", &c.PrivateLinkScopedResources) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, &c.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) case "publicNetworkAccessForIngestion": - err = unpopulate(val, &c.PublicNetworkAccessForIngestion) + err = unpopulate(val, "PublicNetworkAccessForIngestion", &c.PublicNetworkAccessForIngestion) delete(rawMsg, key) case "publicNetworkAccessForQuery": - err = unpopulate(val, &c.PublicNetworkAccessForQuery) + err = unpopulate(val, "PublicNetworkAccessForQuery", &c.PublicNetworkAccessForQuery) delete(rawMsg, key) case "Request_Source": - err = unpopulate(val, &c.RequestSource) + err = unpopulate(val, "RequestSource", &c.RequestSource) delete(rawMsg, key) case "RetentionInDays": - err = unpopulate(val, &c.RetentionInDays) + err = unpopulate(val, "RetentionInDays", &c.RetentionInDays) delete(rawMsg, key) case "SamplingPercentage": - err = unpopulate(val, &c.SamplingPercentage) + err = unpopulate(val, "SamplingPercentage", &c.SamplingPercentage) delete(rawMsg, key) case "TenantId": - err = unpopulate(val, &c.TenantID) + err = unpopulate(val, "TenantID", &c.TenantID) delete(rawMsg, key) case "WorkspaceResourceId": - err = unpopulate(val, &c.WorkspaceResourceID) + err = unpopulate(val, "WorkspaceResourceID", &c.WorkspaceResourceID) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil @@ -326,44 +271,29 @@ func (c ComponentsResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type InnerError. -func (i InnerError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diagnosticcontext", i.Diagnosticcontext) - populateTimeRFC3339(objectMap, "time", i.Time) - return json.Marshal(objectMap) -} - // UnmarshalJSON implements the json.Unmarshaller interface for type InnerError. func (i *InnerError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "diagnosticcontext": - err = unpopulate(val, &i.Diagnosticcontext) + err = unpopulate(val, "Diagnosticcontext", &i.Diagnosticcontext) delete(rawMsg, key) case "time": - err = unpopulateTimeRFC3339(val, &i.Time) + err = unpopulateTimeRFC3339(val, "Time", &i.Time) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InnerErrorTrace. -func (i InnerErrorTrace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "trace", i.Trace) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -418,30 +348,6 @@ func (m MyWorkbookResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type MyWorkbooksListResult. -func (m MyWorkbooksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationsListResult. -func (o OperationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -458,32 +364,32 @@ func (s SystemData) MarshalJSON() ([]byte, error) { func (s *SystemData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": - err = unpopulate(val, &s.CreatedBy) + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) case "createdByType": - err = unpopulate(val, &s.CreatedByType) + err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) delete(rawMsg, key) case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil @@ -520,21 +426,6 @@ func (w WebTest) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WebTestListResult. -func (w WebTestListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebTestLocationsListResult. -func (w WebTestLocationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WebTestProperties. func (w WebTestProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -563,13 +454,6 @@ func (w WebtestsResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WorkItemConfigurationsListResult. -func (w WorkItemConfigurationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WorkItemCreateConfiguration. func (w WorkItemCreateConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -596,13 +480,6 @@ func (w Workbook) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WorkbookInnerErrorTrace. -func (w WorkbookInnerErrorTrace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "trace", w.Trace) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WorkbookProperties. func (w WorkbookProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -624,47 +501,47 @@ func (w WorkbookProperties) MarshalJSON() ([]byte, error) { func (w *WorkbookProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { case "category": - err = unpopulate(val, &w.Category) + err = unpopulate(val, "Category", &w.Category) delete(rawMsg, key) case "description": - err = unpopulate(val, &w.Description) + err = unpopulate(val, "Description", &w.Description) delete(rawMsg, key) case "displayName": - err = unpopulate(val, &w.DisplayName) + err = unpopulate(val, "DisplayName", &w.DisplayName) delete(rawMsg, key) case "revision": - err = unpopulate(val, &w.Revision) + err = unpopulate(val, "Revision", &w.Revision) delete(rawMsg, key) case "serializedData": - err = unpopulate(val, &w.SerializedData) + err = unpopulate(val, "SerializedData", &w.SerializedData) delete(rawMsg, key) case "sourceId": - err = unpopulate(val, &w.SourceID) + err = unpopulate(val, "SourceID", &w.SourceID) delete(rawMsg, key) case "storageUri": - err = unpopulate(val, &w.StorageURI) + err = unpopulate(val, "StorageURI", &w.StorageURI) delete(rawMsg, key) case "tags": - err = unpopulate(val, &w.Tags) + err = unpopulate(val, "Tags", &w.Tags) delete(rawMsg, key) case "timeModified": - err = unpopulateTimeRFC3339(val, &w.TimeModified) + err = unpopulateTimeRFC3339(val, "TimeModified", &w.TimeModified) delete(rawMsg, key) case "userId": - err = unpopulate(val, &w.UserID) + err = unpopulate(val, "UserID", &w.UserID) delete(rawMsg, key) case "version": - err = unpopulate(val, &w.Version) + err = unpopulate(val, "Version", &w.Version) delete(rawMsg, key) } if err != nil { - return err + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil @@ -718,15 +595,6 @@ func (w WorkbookTemplate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateErrorBody. -func (w WorkbookTemplateErrorBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", w.Code) - populate(objectMap, "details", w.Details) - populate(objectMap, "message", w.Message) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateLocalizedGallery. func (w WorkbookTemplateLocalizedGallery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -765,13 +633,6 @@ func (w WorkbookTemplateUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplatesListResult. -func (w WorkbookTemplatesListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WorkbookUpdateParameters. func (w WorkbookUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -781,14 +642,6 @@ func (w WorkbookUpdateParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type WorkbooksListResult. -func (w WorkbooksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return @@ -799,9 +652,12 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil } - return json.Unmarshal(data, v) + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go index 2f874158330f..827720d1fe73 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go @@ -39,7 +39,7 @@ func NewMyWorkbooksClient(subscriptionID string, credential azcore.TokenCredenti if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,6 +57,7 @@ func NewMyWorkbooksClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Create a new private workbook. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workbookProperties - Properties that need to be specified to create a new private workbook. @@ -102,7 +103,7 @@ func (client *MyWorkbooksClient) createOrUpdateCreateRequest(ctx context.Context } reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workbookProperties) } @@ -117,6 +118,7 @@ func (client *MyWorkbooksClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Delete a private workbook. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - MyWorkbooksClientDeleteOptions contains the optional parameters for the MyWorkbooksClient.Delete method. @@ -157,12 +159,13 @@ func (client *MyWorkbooksClient) deleteCreateRequest(ctx context.Context, resour reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a single private workbook by its resourceName. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - MyWorkbooksClientGetOptions contains the optional parameters for the MyWorkbooksClient.Get method. @@ -203,7 +206,7 @@ func (client *MyWorkbooksClient) getCreateRequest(ctx context.Context, resourceG reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -218,12 +221,13 @@ func (client *MyWorkbooksClient) getHandleResponse(resp *http.Response) (MyWorkb // NewListByResourceGroupPager - Get all private workbooks defined within a specified resource group and category. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // resourceGroupName - The name of the resource group. The name is case insensitive. // category - Category of workbook to return. // options - MyWorkbooksClientListByResourceGroupOptions contains the optional parameters for the MyWorkbooksClient.ListByResourceGroup // method. func (client *MyWorkbooksClient) NewListByResourceGroupPager(resourceGroupName string, category CategoryType, options *MyWorkbooksClientListByResourceGroupOptions) *runtime.Pager[MyWorkbooksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[MyWorkbooksClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[MyWorkbooksClientListByResourceGroupResponse]{ More: func(page MyWorkbooksClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -278,7 +282,7 @@ func (client *MyWorkbooksClient) listByResourceGroupCreateRequest(ctx context.Co } reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -293,11 +297,12 @@ func (client *MyWorkbooksClient) listByResourceGroupHandleResponse(resp *http.Re // NewListBySubscriptionPager - Get all private workbooks defined within a specified subscription and category. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // category - Category of workbook to return. // options - MyWorkbooksClientListBySubscriptionOptions contains the optional parameters for the MyWorkbooksClient.ListBySubscription // method. func (client *MyWorkbooksClient) NewListBySubscriptionPager(category CategoryType, options *MyWorkbooksClientListBySubscriptionOptions) *runtime.Pager[MyWorkbooksClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PageProcessor[MyWorkbooksClientListBySubscriptionResponse]{ + return runtime.NewPager(runtime.PagingHandler[MyWorkbooksClientListBySubscriptionResponse]{ More: func(page MyWorkbooksClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -345,7 +350,7 @@ func (client *MyWorkbooksClient) listBySubscriptionCreateRequest(ctx context.Con } reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -360,6 +365,7 @@ func (client *MyWorkbooksClient) listBySubscriptionHandleResponse(resp *http.Res // Update - Updates a private workbook that has already been added. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workbookProperties - Properties that need to be specified to create a new private workbook. @@ -404,7 +410,7 @@ func (client *MyWorkbooksClient) updateCreateRequest(ctx context.Context, resour } reqQP.Set("api-version", "2021-03-08") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workbookProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go index e52bf5ca7b98..57bee9c700b7 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go @@ -38,7 +38,7 @@ func NewProactiveDetectionConfigurationsClient(subscriptionID string, credential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewProactiveDetectionConfigurationsClient(subscriptionID string, credential // Get - Get the ProactiveDetection configuration for this configuration id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // configurationID - The ProactiveDetection configuration ID. This is unique within a Application Insights component. @@ -102,7 +103,7 @@ func (client *ProactiveDetectionConfigurationsClient) getCreateRequest(ctx conte reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -117,6 +118,7 @@ func (client *ProactiveDetectionConfigurationsClient) getHandleResponse(resp *ht // List - Gets a list of ProactiveDetection configurations of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - ProactiveDetectionConfigurationsClientListOptions contains the optional parameters for the ProactiveDetectionConfigurationsClient.List @@ -158,7 +160,7 @@ func (client *ProactiveDetectionConfigurationsClient) listCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -173,6 +175,7 @@ func (client *ProactiveDetectionConfigurationsClient) listHandleResponse(resp *h // Update - Update the ProactiveDetection configuration for this configuration id. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // configurationID - The ProactiveDetection configuration ID. This is unique within a Application Insights component. @@ -220,7 +223,7 @@ func (client *ProactiveDetectionConfigurationsClient) updateCreateRequest(ctx co reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, proactiveDetectionProperties) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go index 7bff7da7141e..1b33cb686760 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go @@ -10,6 +10,7 @@ package armapplicationinsights import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" @@ -72,13 +73,13 @@ func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { m[k] = (*timeRFC3339)(t) } -func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { if data == nil || strings.EqualFold(string(data), "null") { return nil } var aux timeRFC3339 if err := json.Unmarshal(data, &aux); err != nil { - return err + return fmt.Errorf("struct field %s: %v", fn, err) } *t = (*time.Time)(&aux) return nil diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go index 0288ac059e42..f74c61564577 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go @@ -38,7 +38,7 @@ func NewWebTestLocationsClient(subscriptionID string, credential azcore.TokenCre if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,11 +56,12 @@ func NewWebTestLocationsClient(subscriptionID string, credential azcore.TokenCre // NewListPager - Gets a list of web test locations available to this Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WebTestLocationsClientListOptions contains the optional parameters for the WebTestLocationsClient.List method. func (client *WebTestLocationsClient) NewListPager(resourceGroupName string, resourceName string, options *WebTestLocationsClientListOptions) *runtime.Pager[WebTestLocationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[WebTestLocationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[WebTestLocationsClientListResponse]{ More: func(page WebTestLocationsClientListResponse) bool { return false }, @@ -103,7 +104,7 @@ func (client *WebTestLocationsClient) listCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go index d6bd085da38b..f65821d7dccc 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go @@ -38,7 +38,7 @@ func NewWebTestsClient(subscriptionID string, credential azcore.TokenCredential, if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewWebTestsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates an Application Insights web test definition. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // webTestName - The name of the Application Insights webtest resource. // webTestDefinition - Properties that need to be specified to create or update an Application Insights web test definition. @@ -97,7 +98,7 @@ func (client *WebTestsClient) createOrUpdateCreateRequest(ctx context.Context, r reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, webTestDefinition) } @@ -112,6 +113,7 @@ func (client *WebTestsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes an Application Insights web test. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // webTestName - The name of the Application Insights webtest resource. // options - WebTestsClientDeleteOptions contains the optional parameters for the WebTestsClient.Delete method. @@ -157,6 +159,7 @@ func (client *WebTestsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a specific Application Insights web test definition. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // webTestName - The name of the Application Insights webtest resource. // options - WebTestsClientGetOptions contains the optional parameters for the WebTestsClient.Get method. @@ -197,7 +200,7 @@ func (client *WebTestsClient) getCreateRequest(ctx context.Context, resourceGrou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -212,9 +215,10 @@ func (client *WebTestsClient) getHandleResponse(resp *http.Response) (WebTestsCl // NewListPager - Get all Application Insights web test alerts definitions within a subscription. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // options - WebTestsClientListOptions contains the optional parameters for the WebTestsClient.List method. func (client *WebTestsClient) NewListPager(options *WebTestsClientListOptions) *runtime.Pager[WebTestsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[WebTestsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[WebTestsClientListResponse]{ More: func(page WebTestsClientListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -255,7 +259,7 @@ func (client *WebTestsClient) listCreateRequest(ctx context.Context, options *We reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -270,12 +274,13 @@ func (client *WebTestsClient) listHandleResponse(resp *http.Response) (WebTestsC // NewListByComponentPager - Get all Application Insights web tests defined for the specified component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // componentName - The name of the Application Insights component resource. // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WebTestsClientListByComponentOptions contains the optional parameters for the WebTestsClient.ListByComponent // method. func (client *WebTestsClient) NewListByComponentPager(componentName string, resourceGroupName string, options *WebTestsClientListByComponentOptions) *runtime.Pager[WebTestsClientListByComponentResponse] { - return runtime.NewPager(runtime.PageProcessor[WebTestsClientListByComponentResponse]{ + return runtime.NewPager(runtime.PagingHandler[WebTestsClientListByComponentResponse]{ More: func(page WebTestsClientListByComponentResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -324,7 +329,7 @@ func (client *WebTestsClient) listByComponentCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -339,11 +344,12 @@ func (client *WebTestsClient) listByComponentHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Get all Application Insights web tests defined within a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WebTestsClientListByResourceGroupOptions contains the optional parameters for the WebTestsClient.ListByResourceGroup // method. func (client *WebTestsClient) NewListByResourceGroupPager(resourceGroupName string, options *WebTestsClientListByResourceGroupOptions) *runtime.Pager[WebTestsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[WebTestsClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[WebTestsClientListByResourceGroupResponse]{ More: func(page WebTestsClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -388,7 +394,7 @@ func (client *WebTestsClient) listByResourceGroupCreateRequest(ctx context.Conte reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -403,6 +409,7 @@ func (client *WebTestsClient) listByResourceGroupHandleResponse(resp *http.Respo // UpdateTags - Creates or updates an Application Insights web test definition. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // webTestName - The name of the Application Insights webtest resource. // webTestTags - Updated tag information to set into the web test instance. @@ -444,7 +451,7 @@ func (client *WebTestsClient) updateTagsCreateRequest(ctx context.Context, resou reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, webTestTags) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go index dae81ee5224d..2b1690ce5b0a 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go @@ -39,7 +39,7 @@ func NewWorkbooksClient(subscriptionID string, credential azcore.TokenCredential if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -57,8 +57,9 @@ func NewWorkbooksClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Create a new workbook. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // workbookProperties - Properties that need to be specified to create a new workbook. // options - WorkbooksClientCreateOrUpdateOptions contains the optional parameters for the WorkbooksClient.CreateOrUpdate // method. @@ -100,9 +101,9 @@ func (client *WorkbooksClient) createOrUpdateCreateRequest(ctx context.Context, if options != nil && options.SourceID != nil { reqQP.Set("sourceId", *options.SourceID) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workbookProperties) } @@ -117,8 +118,9 @@ func (client *WorkbooksClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Delete a workbook. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // options - WorkbooksClientDeleteOptions contains the optional parameters for the WorkbooksClient.Delete method. func (client *WorkbooksClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientDeleteOptions) (WorkbooksClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) @@ -155,16 +157,17 @@ func (client *WorkbooksClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a single workbook by its resourceName. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // options - WorkbooksClientGetOptions contains the optional parameters for the WorkbooksClient.Get method. func (client *WorkbooksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientGetOptions) (WorkbooksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) @@ -201,12 +204,12 @@ func (client *WorkbooksClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") if options != nil && options.CanFetchContent != nil { reqQP.Set("canFetchContent", strconv.FormatBool(*options.CanFetchContent)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -221,12 +224,13 @@ func (client *WorkbooksClient) getHandleResponse(resp *http.Response) (Workbooks // NewListByResourceGroupPager - Get all Workbooks defined within a specified resource group and category. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // category - Category of workbook to return. // options - WorkbooksClientListByResourceGroupOptions contains the optional parameters for the WorkbooksClient.ListByResourceGroup // method. func (client *WorkbooksClient) NewListByResourceGroupPager(resourceGroupName string, category CategoryType, options *WorkbooksClientListByResourceGroupOptions) *runtime.Pager[WorkbooksClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[WorkbooksClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[WorkbooksClientListByResourceGroupResponse]{ More: func(page WorkbooksClientListByResourceGroupResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -279,9 +283,9 @@ func (client *WorkbooksClient) listByResourceGroupCreateRequest(ctx context.Cont if options != nil && options.CanFetchContent != nil { reqQP.Set("canFetchContent", strconv.FormatBool(*options.CanFetchContent)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -296,11 +300,12 @@ func (client *WorkbooksClient) listByResourceGroupHandleResponse(resp *http.Resp // NewListBySubscriptionPager - Get all Workbooks defined within a specified subscription and category. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // category - Category of workbook to return. // options - WorkbooksClientListBySubscriptionOptions contains the optional parameters for the WorkbooksClient.ListBySubscription // method. func (client *WorkbooksClient) NewListBySubscriptionPager(category CategoryType, options *WorkbooksClientListBySubscriptionOptions) *runtime.Pager[WorkbooksClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PageProcessor[WorkbooksClientListBySubscriptionResponse]{ + return runtime.NewPager(runtime.PagingHandler[WorkbooksClientListBySubscriptionResponse]{ More: func(page WorkbooksClientListBySubscriptionResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -346,9 +351,9 @@ func (client *WorkbooksClient) listBySubscriptionCreateRequest(ctx context.Conte if options != nil && options.CanFetchContent != nil { reqQP.Set("canFetchContent", strconv.FormatBool(*options.CanFetchContent)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -363,8 +368,9 @@ func (client *WorkbooksClient) listBySubscriptionHandleResponse(resp *http.Respo // RevisionGet - Get a single workbook revision defined by its revisionId. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // revisionID - The id of the workbook's revision. // options - WorkbooksClientRevisionGetOptions contains the optional parameters for the WorkbooksClient.RevisionGet method. func (client *WorkbooksClient) RevisionGet(ctx context.Context, resourceGroupName string, resourceName string, revisionID string, options *WorkbooksClientRevisionGetOptions) (WorkbooksClientRevisionGetResponse, error) { @@ -406,9 +412,9 @@ func (client *WorkbooksClient) revisionGetCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -423,11 +429,12 @@ func (client *WorkbooksClient) revisionGetHandleResponse(resp *http.Response) (W // NewRevisionsListPager - Get the revisions for the workbook defined by its resourceName. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // options - WorkbooksClientRevisionsListOptions contains the optional parameters for the WorkbooksClient.RevisionsList method. func (client *WorkbooksClient) NewRevisionsListPager(resourceGroupName string, resourceName string, options *WorkbooksClientRevisionsListOptions) *runtime.Pager[WorkbooksClientRevisionsListResponse] { - return runtime.NewPager(runtime.PageProcessor[WorkbooksClientRevisionsListResponse]{ + return runtime.NewPager(runtime.PagingHandler[WorkbooksClientRevisionsListResponse]{ More: func(page WorkbooksClientRevisionsListResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 }, @@ -474,9 +481,9 @@ func (client *WorkbooksClient) revisionsListCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -491,8 +498,9 @@ func (client *WorkbooksClient) revisionsListHandleResponse(resp *http.Response) // Update - Updates a workbook that has already been added. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. -// resourceName - The name of the Application Insights component resource. +// resourceName - The name of the resource. // options - WorkbooksClientUpdateOptions contains the optional parameters for the WorkbooksClient.Update method. func (client *WorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientUpdateOptions) (WorkbooksClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, options) @@ -532,9 +540,9 @@ func (client *WorkbooksClient) updateCreateRequest(ctx context.Context, resource if options != nil && options.SourceID != nil { reqQP.Set("sourceId", *options.SourceID) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.WorkbookUpdateParameters != nil { return req, runtime.MarshalAsJSON(req, *options.WorkbookUpdateParameters) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go index b6af7dad04c7..b6817ad082fe 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go @@ -38,7 +38,7 @@ func NewWorkbookTemplatesClient(subscriptionID string, credential azcore.TokenCr if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewWorkbookTemplatesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create a new workbook template. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-11-20 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workbookTemplateProperties - Properties that need to be specified to create a new workbook. @@ -98,7 +99,7 @@ func (client *WorkbookTemplatesClient) createOrUpdateCreateRequest(ctx context.C reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workbookTemplateProperties) } @@ -113,6 +114,7 @@ func (client *WorkbookTemplatesClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete a workbook template. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-11-20 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WorkbookTemplatesClientDeleteOptions contains the optional parameters for the WorkbookTemplatesClient.Delete @@ -154,12 +156,13 @@ func (client *WorkbookTemplatesClient) deleteCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a single workbook template by its resourceName. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-11-20 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WorkbookTemplatesClientGetOptions contains the optional parameters for the WorkbookTemplatesClient.Get method. @@ -200,7 +203,7 @@ func (client *WorkbookTemplatesClient) getCreateRequest(ctx context.Context, res reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -215,11 +218,12 @@ func (client *WorkbookTemplatesClient) getHandleResponse(resp *http.Response) (W // NewListByResourceGroupPager - Get all Workbook templates defined within a specified resource group. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-11-20 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WorkbookTemplatesClientListByResourceGroupOptions contains the optional parameters for the WorkbookTemplatesClient.ListByResourceGroup // method. func (client *WorkbookTemplatesClient) NewListByResourceGroupPager(resourceGroupName string, options *WorkbookTemplatesClientListByResourceGroupOptions) *runtime.Pager[WorkbookTemplatesClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PageProcessor[WorkbookTemplatesClientListByResourceGroupResponse]{ + return runtime.NewPager(runtime.PagingHandler[WorkbookTemplatesClientListByResourceGroupResponse]{ More: func(page WorkbookTemplatesClientListByResourceGroupResponse) bool { return false }, @@ -258,7 +262,7 @@ func (client *WorkbookTemplatesClient) listByResourceGroupCreateRequest(ctx cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -273,6 +277,7 @@ func (client *WorkbookTemplatesClient) listByResourceGroupHandleResponse(resp *h // Update - Updates a workbook template that has already been added. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2020-11-20 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WorkbookTemplatesClientUpdateOptions contains the optional parameters for the WorkbookTemplatesClient.Update @@ -314,7 +319,7 @@ func (client *WorkbookTemplatesClient) updateCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.WorkbookTemplateUpdateParameters != nil { return req, runtime.MarshalAsJSON(req, *options.WorkbookTemplateUpdateParameters) } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go index 2bfc6061f56f..5dcd48847dda 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go @@ -38,7 +38,7 @@ func NewWorkItemConfigurationsClient(subscriptionID string, credential azcore.To if options == nil { options = &arm.ClientOptions{} } - ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { ep = c.Endpoint } @@ -56,6 +56,7 @@ func NewWorkItemConfigurationsClient(subscriptionID string, credential azcore.To // Create - Create a work item configuration for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workItemConfigurationProperties - Properties that need to be specified to create a work item configuration of a Application @@ -99,7 +100,7 @@ func (client *WorkItemConfigurationsClient) createCreateRequest(ctx context.Cont reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workItemConfigurationProperties) } @@ -114,6 +115,7 @@ func (client *WorkItemConfigurationsClient) createHandleResponse(resp *http.Resp // Delete - Delete a work item configuration of an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector @@ -166,6 +168,7 @@ func (client *WorkItemConfigurationsClient) deleteCreateRequest(ctx context.Cont // GetDefault - Gets default work item configurations that exist for the application // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WorkItemConfigurationsClientGetDefaultOptions contains the optional parameters for the WorkItemConfigurationsClient.GetDefault @@ -207,7 +210,7 @@ func (client *WorkItemConfigurationsClient) getDefaultCreateRequest(ctx context. reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -222,6 +225,7 @@ func (client *WorkItemConfigurationsClient) getDefaultHandleResponse(resp *http. // GetItem - Gets specified work item configuration for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector @@ -269,7 +273,7 @@ func (client *WorkItemConfigurationsClient) getItemCreateRequest(ctx context.Con reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -284,12 +288,13 @@ func (client *WorkItemConfigurationsClient) getItemHandleResponse(resp *http.Res // NewListPager - Gets the list work item configurations that exist for the application // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // options - WorkItemConfigurationsClientListOptions contains the optional parameters for the WorkItemConfigurationsClient.List // method. func (client *WorkItemConfigurationsClient) NewListPager(resourceGroupName string, resourceName string, options *WorkItemConfigurationsClientListOptions) *runtime.Pager[WorkItemConfigurationsClientListResponse] { - return runtime.NewPager(runtime.PageProcessor[WorkItemConfigurationsClientListResponse]{ + return runtime.NewPager(runtime.PagingHandler[WorkItemConfigurationsClientListResponse]{ More: func(page WorkItemConfigurationsClientListResponse) bool { return false }, @@ -332,7 +337,7 @@ func (client *WorkItemConfigurationsClient) listCreateRequest(ctx context.Contex reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -347,6 +352,7 @@ func (client *WorkItemConfigurationsClient) listHandleResponse(resp *http.Respon // UpdateItem - Update a work item configuration for an Application Insights component. // If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2015-05-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the Application Insights component resource. // workItemConfigID - The unique work item configuration Id. This can be either friendly name of connector as defined in connector @@ -396,7 +402,7 @@ func (client *WorkItemConfigurationsClient) updateItemCreateRequest(ctx context. reqQP := req.Raw().URL.Query() reqQP.Set("api-version", "2015-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") + req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workItemConfigurationProperties) }