diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md b/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md index bedf1442fb41..21c26e27a038 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/CHANGELOG.md @@ -1,5 +1,31 @@ # Release History +## 2.0.0-beta.2 (2022-07-04) +### Breaking Changes + +- Function `*WorkbookTemplatesClient.Update` parameter(s) have been changed from `(context.Context, string, string, *WorkbookTemplatesClientUpdateOptions)` to `(context.Context, string, string, WorkbookTemplateUpdateParameters, *WorkbookTemplatesClientUpdateOptions)` +- Function `*WorkbooksClient.Update` parameter(s) have been changed from `(context.Context, string, string, *WorkbooksClientUpdateOptions)` to `(context.Context, string, string, WorkbookUpdateParameters, *WorkbooksClientUpdateOptions)` +- Field `WorkbookTemplateUpdateParameters` of struct `WorkbookTemplatesClientUpdateOptions` has been removed +- Field `WorkbookUpdateParameters` of struct `WorkbooksClientUpdateOptions` has been removed + +### Features Added + +- New const `WebTestKindStandard` +- New function `*OperationsClient.NewListPager(*OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]` +- New function `NewOperationsClient(azcore.TokenCredential, *arm.ClientOptions) (*OperationsClient, error)` +- New struct `ErrorFieldContract` +- New struct `HeaderField` +- New struct `OperationsClient` +- New struct `OperationsClientListOptions` +- New struct `OperationsClientListResponse` +- New struct `WebTestPropertiesRequest` +- New struct `WebTestPropertiesValidationRules` +- New struct `WebTestPropertiesValidationRulesContentValidation` +- New field `ValidationRules` in struct `WebTestProperties` +- New field `Request` in struct `WebTestProperties` +- New field `Details` in struct `ErrorResponse` + + ## 2.0.0-beta.1 (2022-06-02) ### Breaking Changes diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/analyticsitems_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/analyticsitems_client.go index 3c34910b7c54..180b0c049431 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_analyticsitems_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/analyticsitems_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/annotations_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/annotations_client.go index 6056851ed51e..df65b53b939b 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_annotations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/annotations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/apikeys_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/apikeys_client.go index bd1b7e469633..8b0b91f0677c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_apikeys_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/apikeys_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md b/sdk/resourcemanager/applicationinsights/armapplicationinsights/autorest.md index b0566cde58cb..e80e13712dbc 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/7932c2df6c8435d6c0e5cbebbca79bce627d5f06/specification/applicationinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7932c2df6c8435d6c0e5cbebbca79bce627d5f06/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: 2.0.0-beta.1 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentavailablefeatures_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/componentavailablefeatures_client.go index 4191b2e0317c..001d43109c99 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentavailablefeatures_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentavailablefeatures_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentcurrentbillingfeatures_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/componentcurrentbillingfeatures_client.go index 720762afda77..e1cc3b60f19c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentcurrentbillingfeatures_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentcurrentbillingfeatures_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentfeaturecapabilities_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/componentfeaturecapabilities_client.go index cf38e9f7431b..c26f0c9d04ed 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentfeaturecapabilities_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentfeaturecapabilities_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentlinkedstorageaccounts_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/componentlinkedstorageaccounts_client.go index 2b61b8dea873..18e639c6ca6c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentlinkedstorageaccounts_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentlinkedstorageaccounts_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentquotastatus_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/componentquotastatus_client.go index 0224b27d9d09..b5fa85bbf709 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_componentquotastatus_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/componentquotastatus_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/components_client.go similarity index 98% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/components_client.go index 2a4e5bf938a6..bbd1f879260b 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_components_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/components_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -406,7 +407,11 @@ func (client *ComponentsClient) listByResourceGroupHandleResponse(resp *http.Res // In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution // of purge requests by sending a single command whose predicate includes all // 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. +// to using for a purge request to verify that the results are expected. Note: +// this operation is intended for Classic resources, for workspace-based Application Insights resource please run purge operation +// (directly on the +// workspace)(https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-purge/purge) , scoped to specific resource +// id. // 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. diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/constants.go similarity index 98% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/constants.go index 5325838b08d5..8fbb194a522e 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/constants.go @@ -5,12 +5,13 @@ // 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. +// DO NOT EDIT. package armapplicationinsights const ( moduleName = "armapplicationinsights" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) // ApplicationType - Type of application being monitored. @@ -333,12 +334,13 @@ func PossibleStorageTypeValues() []StorageType { } } -// WebTestKind - The kind of web test that this web test watches. Choices are ping and multistep. +// WebTestKind - The kind of WebTest that this web test watches. Choices are ping, multistep and standard. type WebTestKind string const ( WebTestKindPing WebTestKind = "ping" WebTestKindMultistep WebTestKind = "multistep" + WebTestKindStandard WebTestKind = "standard" ) // PossibleWebTestKindValues returns the possible values for the WebTestKind const type. @@ -346,6 +348,7 @@ func PossibleWebTestKindValues() []WebTestKind { return []WebTestKind{ WebTestKindPing, WebTestKindMultistep, + WebTestKindStandard, } } diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/exportconfigurations_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/exportconfigurations_client.go index 123bf3e017d9..07ae5bd853b7 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_exportconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/exportconfigurations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/favorites_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/favorites_client.go index bf36bdeeaf6b..8170a3e8ab9c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_favorites_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/favorites_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod index da25c4681c1a..88a52f43b782 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // 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-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/go.sum @@ -1,33 +1,15 @@ 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/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= 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/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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 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/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/livetoken_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/livetoken_client.go index b1fe546f329e..8e9e7421e016 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_livetoken_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/livetoken_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/models.go similarity index 94% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/models.go index b6f1efde4a1a..b915ace20d9c 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/models.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -853,12 +854,27 @@ type ErrorDefinition struct { Message *string `json:"message,omitempty" azure:"ro"` } +// ErrorFieldContract - Error Field contract. +type ErrorFieldContract struct { + // Property level error code. + Code *string `json:"code,omitempty"` + + // Human-readable representation of property-level error. + Message *string `json:"message,omitempty"` + + // Property name. + Target *string `json:"target,omitempty"` +} + // ErrorResponse - Error response indicates Insights service is not able to process the incoming request. The reason is provided // in the error message. type ErrorResponse struct { // Error code. Code *string `json:"code,omitempty"` + // The list of invalid fields send in request, in case of validation error. + Details []*ErrorFieldContract `json:"details,omitempty"` + // Error message indicating why the operation failed. Message *string `json:"message,omitempty"` } @@ -953,6 +969,15 @@ type FavoritesClientUpdateOptions struct { // placeholder for future optional parameters } +// HeaderField - A header to add to the WebTest. +type HeaderField struct { + // The name of the header. + HeaderFieldName *string `json:"key,omitempty"` + + // The value of the header. + HeaderFieldValue *string `json:"value,omitempty"` +} + // InnerError - Inner error type InnerError struct { // Provides correlation for request @@ -1168,7 +1193,7 @@ type MyWorkbooksListResult struct { Value []*MyWorkbook `json:"value,omitempty" azure:"ro"` } -// Operation - CDN REST API operation +// Operation - Azure Workbooks REST API operation type Operation struct { // The object that represents the operation. Display *OperationDisplay `json:"display,omitempty"` @@ -1182,7 +1207,7 @@ type OperationDisplay struct { // Operation type: Read, write, delete, etc. Operation *string `json:"operation,omitempty"` - // Service provider: Microsoft.Cdn + // Service provider: Microsoft.Insights Provider *string `json:"provider,omitempty"` // Resource on which the operation is performed: Profile, endpoint, etc. @@ -1204,13 +1229,13 @@ type OperationInfo struct { Resource *string `json:"resource,omitempty"` } -// OperationListResult - Result of the request to list CDN operations. It contains a list of operations and a URL link to -// get the next set of results. +// OperationListResult - Result of the request to list Azure Workbooks operations. It contains a list of operations and a +// URL link to get the next set of results. type OperationListResult struct { // URL to get the next set of operation list results if there are any. NextLink *string `json:"nextLink,omitempty"` - // List of CDN operations supported by the CDN resource provider. + // List of Workbook operations supported by the Microsoft.Insights resource provider. Value []*Operation `json:"value,omitempty"` } @@ -1232,6 +1257,11 @@ type OperationLive struct { Properties interface{} `json:"properties,omitempty"` } +// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsListResult - Result of the List Operations operation type OperationsListResult struct { // URL to get the next set of operation list results if there are any. @@ -1348,12 +1378,12 @@ type UserAssignedIdentity struct { PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } -// WebTest - An Application Insights web test definition. +// WebTest - An Application Insights WebTest definition. type WebTest struct { // REQUIRED; Resource location Location *string `json:"location,omitempty"` - // The kind of web test that this web test watches. Choices are ping and multistep. + // The kind of WebTest that this web test watches. Choices are ping, multistep and standard. Kind *WebTestKind `json:"kind,omitempty"` // Metadata describing a web test for an Azure resource. @@ -1372,19 +1402,19 @@ type WebTest struct { Type *string `json:"type,omitempty" azure:"ro"` } -// WebTestGeolocation - Geo-physical location to run a web test from. You must specify one or more locations for the test -// to run from. +// WebTestGeolocation - Geo-physical location to run a WebTest from. You must specify one or more locations for the test to +// run from. type WebTestGeolocation struct { - // Location ID for the webtest to run from. + // Location ID for the WebTest to run from. Location *string `json:"Id,omitempty"` } -// WebTestListResult - A list of 0 or more Application Insights web test definitions. +// WebTestListResult - A list of 0 or more Application Insights WebTest definitions. type WebTestListResult struct { - // REQUIRED; Set of Application Insights web test definitions. + // REQUIRED; Set of Application Insights WebTest definitions. Value []*WebTest `json:"value,omitempty"` - // The link to get the next part of the returned list of web tests, should the return set be too large for a single request. + // The link to get the next part of the returned list of WebTest, should the return set be too large for a single request. // May be null. NextLink *string `json:"nextLink,omitempty"` } @@ -1408,7 +1438,7 @@ type WebTestProperties struct { // REQUIRED; Unique ID of this WebTest. This is typically the same value as the Name field. SyntheticMonitorID *string `json:"SyntheticMonitorId,omitempty"` - // REQUIRED; The kind of web test this is, valid choices are ping and multistep. + // REQUIRED; The kind of web test this is, valid choices are ping, multistep and standard. WebTestKind *WebTestKind `json:"Kind,omitempty"` // REQUIRED; User defined name if this WebTest. @@ -1417,7 +1447,7 @@ type WebTestProperties struct { // An XML configuration specification for a WebTest. Configuration *WebTestPropertiesConfiguration `json:"Configuration,omitempty"` - // Purpose/user defined descriptive test for this WebTest. + // User defined description for this WebTest. Description *string `json:"Description,omitempty"` // Is the test actively being monitored. @@ -1426,12 +1456,18 @@ type WebTestProperties struct { // Interval in seconds between test runs for this WebTest. Default value is 300. Frequency *int32 `json:"Frequency,omitempty"` + // The collection of request properties + Request *WebTestPropertiesRequest `json:"Request,omitempty"` + // Allow for retries should this WebTest fail. RetryEnabled *bool `json:"RetryEnabled,omitempty"` // Seconds until this WebTest will timeout and fail. Default value is 30. Timeout *int32 `json:"Timeout,omitempty"` + // The collection of validation rule properties + ValidationRules *WebTestPropertiesValidationRules `json:"ValidationRules,omitempty"` + // READ-ONLY; Current state of this component, whether or not is has been provisioned within the resource group it is defined. // Users cannot change this value but are able to read from it. Values will include // Succeeded, Deploying, Canceled, and Failed. @@ -1444,6 +1480,59 @@ type WebTestPropertiesConfiguration struct { WebTest *string `json:"WebTest,omitempty"` } +// WebTestPropertiesRequest - The collection of request properties +type WebTestPropertiesRequest struct { + // Follow redirects for this web test. + FollowRedirects *bool `json:"FollowRedirects,omitempty"` + + // Http verb to use for this web test. + HTTPVerb *string `json:"HttpVerb,omitempty"` + + // List of headers and their values to add to the WebTest call. + Headers []*HeaderField `json:"Headers,omitempty"` + + // Parse Dependent request for this WebTest. + ParseDependentRequests *bool `json:"ParseDependentRequests,omitempty"` + + // Base64 encoded string body to send with this web test. + RequestBody *string `json:"RequestBody,omitempty"` + + // Url location to test. + RequestURL *string `json:"RequestUrl,omitempty"` +} + +// WebTestPropertiesValidationRules - The collection of validation rule properties +type WebTestPropertiesValidationRules struct { + // The collection of content validation properties + ContentValidation *WebTestPropertiesValidationRulesContentValidation `json:"ContentValidation,omitempty"` + + // Validate that the WebTest returns the http status code provided. + ExpectedHTTPStatusCode *int32 `json:"ExpectedHttpStatusCode,omitempty"` + + // When set, validation will ignore the status code. + IgnoreHTTPSStatusCode *bool `json:"IgnoreHttpsStatusCode,omitempty"` + + // A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck + // must be set to true. + SSLCertRemainingLifetimeCheck *int32 `json:"SSLCertRemainingLifetimeCheck,omitempty"` + + // Checks to see if the SSL cert is still valid. + SSLCheck *bool `json:"SSLCheck,omitempty"` +} + +// WebTestPropertiesValidationRulesContentValidation - The collection of content validation properties +type WebTestPropertiesValidationRulesContentValidation struct { + // Content to look for in the return of the WebTest. Must not be null or empty. + ContentMatch *string `json:"ContentMatch,omitempty"` + + // When set, this value makes the ContentMatch validation case insensitive. + IgnoreCase *bool `json:"IgnoreCase,omitempty"` + + // When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there + // is a match + PassIfTextFound *bool `json:"PassIfTextFound,omitempty"` +} + // WebTestsClientCreateOrUpdateOptions contains the optional parameters for the WebTestsClient.CreateOrUpdate method. type WebTestsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -1891,8 +1980,7 @@ type WorkbookTemplatesClientListByResourceGroupOptions struct { // WorkbookTemplatesClientUpdateOptions contains the optional parameters for the WorkbookTemplatesClient.Update method. type WorkbookTemplatesClientUpdateOptions struct { - // Properties that need to be specified to patch a workbook template. - WorkbookTemplateUpdateParameters *WorkbookTemplateUpdateParameters + // placeholder for future optional parameters } // WorkbookTemplatesListResult - WorkbookTemplate list result. @@ -1966,8 +2054,6 @@ type WorkbooksClientRevisionsListOptions struct { type WorkbooksClientUpdateOptions struct { // Azure Resource Id that will fetch all linked workbooks. SourceID *string - // Properties that need to be specified to create a new workbook. - WorkbookUpdateParameters *WorkbookUpdateParameters } // WorkbooksListResult - Workbook list result. diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/models_serde.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/models_serde.go new file mode 100644 index 000000000000..535805ca5d68 --- /dev/null +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/models_serde.go @@ -0,0 +1,3967 @@ +//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. +// DO NOT EDIT. + +package armapplicationinsights + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type APIKeyRequest. +func (a APIKeyRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "linkedReadProperties", a.LinkedReadProperties) + populate(objectMap, "linkedWriteProperties", a.LinkedWriteProperties) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeyRequest. +func (a *APIKeyRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "linkedReadProperties": + err = unpopulate(val, "LinkedReadProperties", &a.LinkedReadProperties) + delete(rawMsg, key) + case "linkedWriteProperties": + err = unpopulate(val, "LinkedWriteProperties", &a.LinkedWriteProperties) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Annotation. +func (a Annotation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "AnnotationName", a.AnnotationName) + populate(objectMap, "Category", a.Category) + populateTimeRFC3339(objectMap, "EventTime", a.EventTime) + populate(objectMap, "Id", a.ID) + populate(objectMap, "Properties", a.Properties) + populate(objectMap, "RelatedAnnotation", a.RelatedAnnotation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Annotation. +func (a *Annotation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "AnnotationName": + err = unpopulate(val, "AnnotationName", &a.AnnotationName) + delete(rawMsg, key) + case "Category": + err = unpopulate(val, "Category", &a.Category) + delete(rawMsg, key) + case "EventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &a.EventTime) + delete(rawMsg, key) + case "Id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "Properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "RelatedAnnotation": + err = unpopulate(val, "RelatedAnnotation", &a.RelatedAnnotation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AnnotationError. +func (a AnnotationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", a.Code) + populate(objectMap, "innererror", a.Innererror) + populate(objectMap, "message", a.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AnnotationError. +func (a *AnnotationError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &a.Code) + delete(rawMsg, key) + case "innererror": + err = unpopulate(val, "Innererror", &a.Innererror) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &a.Message) + delete(rawMsg, key) + } + if err != nil { + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AnnotationsListResult. +func (a *AnnotationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Component. +func (c Component) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Component. +func (c *Component) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAPIKey. +func (c *ComponentAPIKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiKey": + err = unpopulate(val, "APIKey", &c.APIKey) + delete(rawMsg, key) + case "createdDate": + err = unpopulate(val, "CreatedDate", &c.CreatedDate) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "linkedReadProperties": + err = unpopulate(val, "LinkedReadProperties", &c.LinkedReadProperties) + delete(rawMsg, key) + case "linkedWriteProperties": + err = unpopulate(val, "LinkedWriteProperties", &c.LinkedWriteProperties) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAPIKeyListResult. +func (c *ComponentAPIKeyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentAnalyticsItem. +func (c ComponentAnalyticsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Content", c.Content) + populate(objectMap, "Id", c.ID) + populate(objectMap, "Name", c.Name) + populate(objectMap, "Properties", c.Properties) + populate(objectMap, "Scope", c.Scope) + populate(objectMap, "TimeCreated", c.TimeCreated) + populate(objectMap, "TimeModified", c.TimeModified) + populate(objectMap, "Type", c.Type) + populate(objectMap, "Version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAnalyticsItem. +func (c *ComponentAnalyticsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Content": + err = unpopulate(val, "Content", &c.Content) + delete(rawMsg, key) + case "Id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "Properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "Scope": + err = unpopulate(val, "Scope", &c.Scope) + delete(rawMsg, key) + case "TimeCreated": + err = unpopulate(val, "TimeCreated", &c.TimeCreated) + delete(rawMsg, key) + case "TimeModified": + err = unpopulate(val, "TimeModified", &c.TimeModified) + delete(rawMsg, key) + case "Type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "Version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentAnalyticsItemProperties. +func (c ComponentAnalyticsItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "functionAlias", c.FunctionAlias) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAnalyticsItemProperties. +func (c *ComponentAnalyticsItemProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "functionAlias": + err = unpopulate(val, "FunctionAlias", &c.FunctionAlias) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentAvailableFeatures. +func (c *ComponentAvailableFeatures) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Result": + err = unpopulate(val, "Result", &c.Result) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentBillingFeatures. +func (c ComponentBillingFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "CurrentBillingFeatures", c.CurrentBillingFeatures) + populate(objectMap, "DataVolumeCap", c.DataVolumeCap) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentBillingFeatures. +func (c *ComponentBillingFeatures) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "CurrentBillingFeatures": + err = unpopulate(val, "CurrentBillingFeatures", &c.CurrentBillingFeatures) + delete(rawMsg, key) + case "DataVolumeCap": + err = unpopulate(val, "DataVolumeCap", &c.DataVolumeCap) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentDataVolumeCap. +func (c ComponentDataVolumeCap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Cap", c.Cap) + populate(objectMap, "MaxHistoryCap", c.MaxHistoryCap) + populate(objectMap, "ResetTime", c.ResetTime) + populate(objectMap, "StopSendNotificationWhenHitCap", c.StopSendNotificationWhenHitCap) + populate(objectMap, "StopSendNotificationWhenHitThreshold", c.StopSendNotificationWhenHitThreshold) + populate(objectMap, "WarningThreshold", c.WarningThreshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentDataVolumeCap. +func (c *ComponentDataVolumeCap) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Cap": + err = unpopulate(val, "Cap", &c.Cap) + delete(rawMsg, key) + case "MaxHistoryCap": + err = unpopulate(val, "MaxHistoryCap", &c.MaxHistoryCap) + delete(rawMsg, key) + case "ResetTime": + err = unpopulate(val, "ResetTime", &c.ResetTime) + delete(rawMsg, key) + case "StopSendNotificationWhenHitCap": + err = unpopulate(val, "StopSendNotificationWhenHitCap", &c.StopSendNotificationWhenHitCap) + delete(rawMsg, key) + case "StopSendNotificationWhenHitThreshold": + err = unpopulate(val, "StopSendNotificationWhenHitThreshold", &c.StopSendNotificationWhenHitThreshold) + delete(rawMsg, key) + case "WarningThreshold": + err = unpopulate(val, "WarningThreshold", &c.WarningThreshold) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentExportConfiguration. +func (c ComponentExportConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ApplicationName", c.ApplicationName) + populate(objectMap, "ContainerName", c.ContainerName) + populate(objectMap, "DestinationAccountId", c.DestinationAccountID) + populate(objectMap, "DestinationStorageLocationId", c.DestinationStorageLocationID) + populate(objectMap, "DestinationStorageSubscriptionId", c.DestinationStorageSubscriptionID) + populate(objectMap, "DestinationType", c.DestinationType) + populate(objectMap, "ExportId", c.ExportID) + populate(objectMap, "ExportStatus", c.ExportStatus) + populate(objectMap, "InstrumentationKey", c.InstrumentationKey) + populate(objectMap, "IsUserEnabled", c.IsUserEnabled) + populate(objectMap, "LastGapTime", c.LastGapTime) + populate(objectMap, "LastSuccessTime", c.LastSuccessTime) + populate(objectMap, "LastUserUpdate", c.LastUserUpdate) + populate(objectMap, "NotificationQueueEnabled", c.NotificationQueueEnabled) + populate(objectMap, "PermanentErrorReason", c.PermanentErrorReason) + populate(objectMap, "RecordTypes", c.RecordTypes) + populate(objectMap, "ResourceGroup", c.ResourceGroup) + populate(objectMap, "StorageName", c.StorageName) + populate(objectMap, "SubscriptionId", c.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentExportConfiguration. +func (c *ComponentExportConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ApplicationName": + err = unpopulate(val, "ApplicationName", &c.ApplicationName) + delete(rawMsg, key) + case "ContainerName": + err = unpopulate(val, "ContainerName", &c.ContainerName) + delete(rawMsg, key) + case "DestinationAccountId": + err = unpopulate(val, "DestinationAccountID", &c.DestinationAccountID) + delete(rawMsg, key) + case "DestinationStorageLocationId": + err = unpopulate(val, "DestinationStorageLocationID", &c.DestinationStorageLocationID) + delete(rawMsg, key) + case "DestinationStorageSubscriptionId": + err = unpopulate(val, "DestinationStorageSubscriptionID", &c.DestinationStorageSubscriptionID) + delete(rawMsg, key) + case "DestinationType": + err = unpopulate(val, "DestinationType", &c.DestinationType) + delete(rawMsg, key) + case "ExportId": + err = unpopulate(val, "ExportID", &c.ExportID) + delete(rawMsg, key) + case "ExportStatus": + err = unpopulate(val, "ExportStatus", &c.ExportStatus) + delete(rawMsg, key) + case "InstrumentationKey": + err = unpopulate(val, "InstrumentationKey", &c.InstrumentationKey) + delete(rawMsg, key) + case "IsUserEnabled": + err = unpopulate(val, "IsUserEnabled", &c.IsUserEnabled) + delete(rawMsg, key) + case "LastGapTime": + err = unpopulate(val, "LastGapTime", &c.LastGapTime) + delete(rawMsg, key) + case "LastSuccessTime": + err = unpopulate(val, "LastSuccessTime", &c.LastSuccessTime) + delete(rawMsg, key) + case "LastUserUpdate": + err = unpopulate(val, "LastUserUpdate", &c.LastUserUpdate) + delete(rawMsg, key) + case "NotificationQueueEnabled": + err = unpopulate(val, "NotificationQueueEnabled", &c.NotificationQueueEnabled) + delete(rawMsg, key) + case "PermanentErrorReason": + err = unpopulate(val, "PermanentErrorReason", &c.PermanentErrorReason) + delete(rawMsg, key) + case "RecordTypes": + err = unpopulate(val, "RecordTypes", &c.RecordTypes) + delete(rawMsg, key) + case "ResourceGroup": + err = unpopulate(val, "ResourceGroup", &c.ResourceGroup) + delete(rawMsg, key) + case "StorageName": + err = unpopulate(val, "StorageName", &c.StorageName) + delete(rawMsg, key) + case "SubscriptionId": + err = unpopulate(val, "SubscriptionID", &c.SubscriptionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentExportRequest. +func (c ComponentExportRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "DestinationAccountId", c.DestinationAccountID) + populate(objectMap, "DestinationAddress", c.DestinationAddress) + populate(objectMap, "DestinationStorageLocationId", c.DestinationStorageLocationID) + populate(objectMap, "DestinationStorageSubscriptionId", c.DestinationStorageSubscriptionID) + populate(objectMap, "DestinationType", c.DestinationType) + populate(objectMap, "IsEnabled", c.IsEnabled) + populate(objectMap, "NotificationQueueEnabled", c.NotificationQueueEnabled) + populate(objectMap, "NotificationQueueUri", c.NotificationQueueURI) + populate(objectMap, "RecordTypes", c.RecordTypes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentExportRequest. +func (c *ComponentExportRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "DestinationAccountId": + err = unpopulate(val, "DestinationAccountID", &c.DestinationAccountID) + delete(rawMsg, key) + case "DestinationAddress": + err = unpopulate(val, "DestinationAddress", &c.DestinationAddress) + delete(rawMsg, key) + case "DestinationStorageLocationId": + err = unpopulate(val, "DestinationStorageLocationID", &c.DestinationStorageLocationID) + delete(rawMsg, key) + case "DestinationStorageSubscriptionId": + err = unpopulate(val, "DestinationStorageSubscriptionID", &c.DestinationStorageSubscriptionID) + delete(rawMsg, key) + case "DestinationType": + err = unpopulate(val, "DestinationType", &c.DestinationType) + delete(rawMsg, key) + case "IsEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) + delete(rawMsg, key) + case "NotificationQueueEnabled": + err = unpopulate(val, "NotificationQueueEnabled", &c.NotificationQueueEnabled) + delete(rawMsg, key) + case "NotificationQueueUri": + err = unpopulate(val, "NotificationQueueURI", &c.NotificationQueueURI) + delete(rawMsg, key) + case "RecordTypes": + err = unpopulate(val, "RecordTypes", &c.RecordTypes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentFavorite. +func (c ComponentFavorite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Category", c.Category) + populate(objectMap, "Config", c.Config) + populate(objectMap, "FavoriteId", c.FavoriteID) + populate(objectMap, "FavoriteType", c.FavoriteType) + populate(objectMap, "IsGeneratedFromTemplate", c.IsGeneratedFromTemplate) + populate(objectMap, "Name", c.Name) + populate(objectMap, "SourceType", c.SourceType) + populate(objectMap, "Tags", c.Tags) + populate(objectMap, "TimeModified", c.TimeModified) + populate(objectMap, "UserId", c.UserID) + populate(objectMap, "Version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFavorite. +func (c *ComponentFavorite) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Category": + err = unpopulate(val, "Category", &c.Category) + delete(rawMsg, key) + case "Config": + err = unpopulate(val, "Config", &c.Config) + delete(rawMsg, key) + case "FavoriteId": + err = unpopulate(val, "FavoriteID", &c.FavoriteID) + delete(rawMsg, key) + case "FavoriteType": + err = unpopulate(val, "FavoriteType", &c.FavoriteType) + delete(rawMsg, key) + case "IsGeneratedFromTemplate": + err = unpopulate(val, "IsGeneratedFromTemplate", &c.IsGeneratedFromTemplate) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "SourceType": + err = unpopulate(val, "SourceType", &c.SourceType) + delete(rawMsg, key) + case "Tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "TimeModified": + err = unpopulate(val, "TimeModified", &c.TimeModified) + delete(rawMsg, key) + case "UserId": + err = unpopulate(val, "UserID", &c.UserID) + delete(rawMsg, key) + case "Version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeature. +func (c *ComponentFeature) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Capabilities": + err = unpopulate(val, "Capabilities", &c.Capabilities) + delete(rawMsg, key) + case "FeatureName": + err = unpopulate(val, "FeatureName", &c.FeatureName) + delete(rawMsg, key) + case "IsHidden": + err = unpopulate(val, "IsHidden", &c.IsHidden) + delete(rawMsg, key) + case "IsMainFeature": + err = unpopulate(val, "IsMainFeature", &c.IsMainFeature) + delete(rawMsg, key) + case "MeterId": + err = unpopulate(val, "MeterID", &c.MeterID) + delete(rawMsg, key) + case "MeterRateFrequency": + err = unpopulate(val, "MeterRateFrequency", &c.MeterRateFrequency) + delete(rawMsg, key) + case "ResouceId": + err = unpopulate(val, "ResouceID", &c.ResouceID) + delete(rawMsg, key) + case "SupportedAddonFeatures": + err = unpopulate(val, "SupportedAddonFeatures", &c.SupportedAddonFeatures) + delete(rawMsg, key) + case "Title": + err = unpopulate(val, "Title", &c.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentFeatureCapabilities. +func (c ComponentFeatureCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ApiAccessLevel", c.APIAccessLevel) + populate(objectMap, "AnalyticsIntegration", c.AnalyticsIntegration) + populate(objectMap, "ApplicationMap", c.ApplicationMap) + populate(objectMap, "BurstThrottlePolicy", c.BurstThrottlePolicy) + populate(objectMap, "DailyCap", c.DailyCap) + populate(objectMap, "DailyCapResetTime", c.DailyCapResetTime) + populate(objectMap, "LiveStreamMetrics", c.LiveStreamMetrics) + populate(objectMap, "MetadataClass", c.MetadataClass) + populate(objectMap, "MultipleStepWebTest", c.MultipleStepWebTest) + populate(objectMap, "OpenSchema", c.OpenSchema) + populate(objectMap, "PowerBIIntegration", c.PowerBIIntegration) + populate(objectMap, "ProactiveDetection", c.ProactiveDetection) + populate(objectMap, "SupportExportData", c.SupportExportData) + populate(objectMap, "ThrottleRate", c.ThrottleRate) + populate(objectMap, "TrackingType", c.TrackingType) + populate(objectMap, "WorkItemIntegration", c.WorkItemIntegration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeatureCapabilities. +func (c *ComponentFeatureCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ApiAccessLevel": + err = unpopulate(val, "APIAccessLevel", &c.APIAccessLevel) + delete(rawMsg, key) + case "AnalyticsIntegration": + err = unpopulate(val, "AnalyticsIntegration", &c.AnalyticsIntegration) + delete(rawMsg, key) + case "ApplicationMap": + err = unpopulate(val, "ApplicationMap", &c.ApplicationMap) + delete(rawMsg, key) + case "BurstThrottlePolicy": + err = unpopulate(val, "BurstThrottlePolicy", &c.BurstThrottlePolicy) + delete(rawMsg, key) + case "DailyCap": + err = unpopulate(val, "DailyCap", &c.DailyCap) + delete(rawMsg, key) + case "DailyCapResetTime": + err = unpopulate(val, "DailyCapResetTime", &c.DailyCapResetTime) + delete(rawMsg, key) + case "LiveStreamMetrics": + err = unpopulate(val, "LiveStreamMetrics", &c.LiveStreamMetrics) + delete(rawMsg, key) + case "MetadataClass": + err = unpopulate(val, "MetadataClass", &c.MetadataClass) + delete(rawMsg, key) + case "MultipleStepWebTest": + err = unpopulate(val, "MultipleStepWebTest", &c.MultipleStepWebTest) + delete(rawMsg, key) + case "OpenSchema": + err = unpopulate(val, "OpenSchema", &c.OpenSchema) + delete(rawMsg, key) + case "PowerBIIntegration": + err = unpopulate(val, "PowerBIIntegration", &c.PowerBIIntegration) + delete(rawMsg, key) + case "ProactiveDetection": + err = unpopulate(val, "ProactiveDetection", &c.ProactiveDetection) + delete(rawMsg, key) + case "SupportExportData": + err = unpopulate(val, "SupportExportData", &c.SupportExportData) + delete(rawMsg, key) + case "ThrottleRate": + err = unpopulate(val, "ThrottleRate", &c.ThrottleRate) + delete(rawMsg, key) + case "TrackingType": + err = unpopulate(val, "TrackingType", &c.TrackingType) + delete(rawMsg, key) + case "WorkItemIntegration": + err = unpopulate(val, "WorkItemIntegration", &c.WorkItemIntegration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentFeatureCapability. +func (c ComponentFeatureCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Description", c.Description) + populate(objectMap, "MeterId", c.MeterID) + populate(objectMap, "MeterRateFrequency", c.MeterRateFrequency) + populate(objectMap, "Name", c.Name) + populate(objectMap, "Unit", c.Unit) + populate(objectMap, "Value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentFeatureCapability. +func (c *ComponentFeatureCapability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "MeterId": + err = unpopulate(val, "MeterID", &c.MeterID) + delete(rawMsg, key) + case "MeterRateFrequency": + err = unpopulate(val, "MeterRateFrequency", &c.MeterRateFrequency) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "Unit": + err = unpopulate(val, "Unit", &c.Unit) + delete(rawMsg, key) + case "Value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentLinkedStorageAccounts. +func (c ComponentLinkedStorageAccounts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentLinkedStorageAccounts. +func (c *ComponentLinkedStorageAccounts) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentLinkedStorageAccountsPatch. +func (c ComponentLinkedStorageAccountsPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentLinkedStorageAccountsPatch. +func (c *ComponentLinkedStorageAccountsPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentListResult. +func (c *ComponentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfiguration. +func (c ComponentProactiveDetectionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "CustomEmails", c.CustomEmails) + populate(objectMap, "Enabled", c.Enabled) + populate(objectMap, "LastUpdatedTime", c.LastUpdatedTime) + populate(objectMap, "Name", c.Name) + populate(objectMap, "RuleDefinitions", c.RuleDefinitions) + populate(objectMap, "SendEmailsToSubscriptionOwners", c.SendEmailsToSubscriptionOwners) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProactiveDetectionConfiguration. +func (c *ComponentProactiveDetectionConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "CustomEmails": + err = unpopulate(val, "CustomEmails", &c.CustomEmails) + delete(rawMsg, key) + case "Enabled": + err = unpopulate(val, "Enabled", &c.Enabled) + delete(rawMsg, key) + case "LastUpdatedTime": + err = unpopulate(val, "LastUpdatedTime", &c.LastUpdatedTime) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "RuleDefinitions": + err = unpopulate(val, "RuleDefinitions", &c.RuleDefinitions) + delete(rawMsg, key) + case "SendEmailsToSubscriptionOwners": + err = unpopulate(val, "SendEmailsToSubscriptionOwners", &c.SendEmailsToSubscriptionOwners) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfigurationRuleDefinitions. +func (c ComponentProactiveDetectionConfigurationRuleDefinitions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Description", c.Description) + populate(objectMap, "DisplayName", c.DisplayName) + populate(objectMap, "HelpUrl", c.HelpURL) + populate(objectMap, "IsEnabledByDefault", c.IsEnabledByDefault) + populate(objectMap, "IsHidden", c.IsHidden) + populate(objectMap, "IsInPreview", c.IsInPreview) + populate(objectMap, "Name", c.Name) + populate(objectMap, "SupportsEmailNotifications", c.SupportsEmailNotifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProactiveDetectionConfigurationRuleDefinitions. +func (c *ComponentProactiveDetectionConfigurationRuleDefinitions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "DisplayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "HelpUrl": + err = unpopulate(val, "HelpURL", &c.HelpURL) + delete(rawMsg, key) + case "IsEnabledByDefault": + err = unpopulate(val, "IsEnabledByDefault", &c.IsEnabledByDefault) + delete(rawMsg, key) + case "IsHidden": + err = unpopulate(val, "IsHidden", &c.IsHidden) + delete(rawMsg, key) + case "IsInPreview": + err = unpopulate(val, "IsInPreview", &c.IsInPreview) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "SupportsEmailNotifications": + err = unpopulate(val, "SupportsEmailNotifications", &c.SupportsEmailNotifications) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentProperties. +func (c ComponentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "AppId", c.AppID) + populate(objectMap, "ApplicationId", c.ApplicationID) + populate(objectMap, "Application_Type", c.ApplicationType) + populate(objectMap, "ConnectionString", c.ConnectionString) + populateTimeRFC3339(objectMap, "CreationDate", c.CreationDate) + populate(objectMap, "DisableIpMasking", c.DisableIPMasking) + populate(objectMap, "DisableLocalAuth", c.DisableLocalAuth) + populate(objectMap, "Flow_Type", c.FlowType) + populate(objectMap, "ForceCustomerStorageForProfiler", c.ForceCustomerStorageForProfiler) + populate(objectMap, "HockeyAppId", c.HockeyAppID) + populate(objectMap, "HockeyAppToken", c.HockeyAppToken) + populate(objectMap, "ImmediatePurgeDataOn30Days", c.ImmediatePurgeDataOn30Days) + populate(objectMap, "IngestionMode", c.IngestionMode) + populate(objectMap, "InstrumentationKey", c.InstrumentationKey) + populateTimeRFC3339(objectMap, "LaMigrationDate", c.LaMigrationDate) + populate(objectMap, "Name", c.Name) + populate(objectMap, "PrivateLinkScopedResources", c.PrivateLinkScopedResources) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publicNetworkAccessForIngestion", c.PublicNetworkAccessForIngestion) + populate(objectMap, "publicNetworkAccessForQuery", c.PublicNetworkAccessForQuery) + populate(objectMap, "Request_Source", c.RequestSource) + populate(objectMap, "RetentionInDays", c.RetentionInDays) + populate(objectMap, "SamplingPercentage", c.SamplingPercentage) + populate(objectMap, "TenantId", c.TenantID) + populate(objectMap, "WorkspaceResourceId", c.WorkspaceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProperties. +func (c *ComponentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "AppId": + err = unpopulate(val, "AppID", &c.AppID) + delete(rawMsg, key) + case "ApplicationId": + err = unpopulate(val, "ApplicationID", &c.ApplicationID) + delete(rawMsg, key) + case "Application_Type": + err = unpopulate(val, "ApplicationType", &c.ApplicationType) + delete(rawMsg, key) + case "ConnectionString": + err = unpopulate(val, "ConnectionString", &c.ConnectionString) + delete(rawMsg, key) + case "CreationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &c.CreationDate) + delete(rawMsg, key) + case "DisableIpMasking": + err = unpopulate(val, "DisableIPMasking", &c.DisableIPMasking) + delete(rawMsg, key) + case "DisableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) + delete(rawMsg, key) + case "Flow_Type": + err = unpopulate(val, "FlowType", &c.FlowType) + delete(rawMsg, key) + case "ForceCustomerStorageForProfiler": + err = unpopulate(val, "ForceCustomerStorageForProfiler", &c.ForceCustomerStorageForProfiler) + delete(rawMsg, key) + case "HockeyAppId": + err = unpopulate(val, "HockeyAppID", &c.HockeyAppID) + delete(rawMsg, key) + case "HockeyAppToken": + err = unpopulate(val, "HockeyAppToken", &c.HockeyAppToken) + delete(rawMsg, key) + case "ImmediatePurgeDataOn30Days": + err = unpopulate(val, "ImmediatePurgeDataOn30Days", &c.ImmediatePurgeDataOn30Days) + delete(rawMsg, key) + case "IngestionMode": + err = unpopulate(val, "IngestionMode", &c.IngestionMode) + delete(rawMsg, key) + case "InstrumentationKey": + err = unpopulate(val, "InstrumentationKey", &c.InstrumentationKey) + delete(rawMsg, key) + case "LaMigrationDate": + err = unpopulateTimeRFC3339(val, "LaMigrationDate", &c.LaMigrationDate) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "PrivateLinkScopedResources": + err = unpopulate(val, "PrivateLinkScopedResources", &c.PrivateLinkScopedResources) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccessForIngestion": + err = unpopulate(val, "PublicNetworkAccessForIngestion", &c.PublicNetworkAccessForIngestion) + delete(rawMsg, key) + case "publicNetworkAccessForQuery": + err = unpopulate(val, "PublicNetworkAccessForQuery", &c.PublicNetworkAccessForQuery) + delete(rawMsg, key) + case "Request_Source": + err = unpopulate(val, "RequestSource", &c.RequestSource) + delete(rawMsg, key) + case "RetentionInDays": + err = unpopulate(val, "RetentionInDays", &c.RetentionInDays) + delete(rawMsg, key) + case "SamplingPercentage": + err = unpopulate(val, "SamplingPercentage", &c.SamplingPercentage) + delete(rawMsg, key) + case "TenantId": + err = unpopulate(val, "TenantID", &c.TenantID) + delete(rawMsg, key) + case "WorkspaceResourceId": + err = unpopulate(val, "WorkspaceResourceID", &c.WorkspaceResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentPurgeBody. +func (c ComponentPurgeBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filters", c.Filters) + populate(objectMap, "table", c.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeBody. +func (c *ComponentPurgeBody) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "filters": + err = unpopulate(val, "Filters", &c.Filters) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &c.Table) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentPurgeBodyFilters. +func (c ComponentPurgeBodyFilters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "column", c.Column) + populate(objectMap, "key", c.Key) + populate(objectMap, "operator", c.Operator) + populate(objectMap, "value", &c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeBodyFilters. +func (c *ComponentPurgeBodyFilters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "column": + err = unpopulate(val, "Column", &c.Column) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &c.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &c.Operator) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentPurgeResponse. +func (c ComponentPurgeResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationId", c.OperationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeResponse. +func (c *ComponentPurgeResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operationId": + err = unpopulate(val, "OperationID", &c.OperationID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentPurgeStatusResponse. +func (c ComponentPurgeStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentPurgeStatusResponse. +func (c *ComponentPurgeStatusResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentQuotaStatus. +func (c ComponentQuotaStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "AppId", c.AppID) + populate(objectMap, "ExpirationTime", c.ExpirationTime) + populate(objectMap, "ShouldBeThrottled", c.ShouldBeThrottled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentQuotaStatus. +func (c *ComponentQuotaStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "AppId": + err = unpopulate(val, "AppID", &c.AppID) + delete(rawMsg, key) + case "ExpirationTime": + err = unpopulate(val, "ExpirationTime", &c.ExpirationTime) + delete(rawMsg, key) + case "ShouldBeThrottled": + err = unpopulate(val, "ShouldBeThrottled", &c.ShouldBeThrottled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentWebTestLocation. +func (c ComponentWebTestLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "DisplayName", c.DisplayName) + populate(objectMap, "Tag", c.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentWebTestLocation. +func (c *ComponentWebTestLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "DisplayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "Tag": + err = unpopulate(val, "Tag", &c.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentsResource. +func (c ComponentsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsResource. +func (c *ComponentsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDefinition. +func (e ErrorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "innererror", &e.Innererror) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDefinition. +func (e *ErrorDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "innererror": + err = unpopulate(val, "Innererror", &e.Innererror) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorFieldContract. +func (e ErrorFieldContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract. +func (e *ErrorFieldContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseComponents. +func (e ErrorResponseComponents) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseComponents. +func (e *ErrorResponseComponents) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseComponentsError. +func (e ErrorResponseComponentsError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseComponentsError. +func (e *ErrorResponseComponentsError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseLinkedStorage. +func (e ErrorResponseLinkedStorage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseLinkedStorage. +func (e *ErrorResponseLinkedStorage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseLinkedStorageError. +func (e ErrorResponseLinkedStorageError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseLinkedStorageError. +func (e *ErrorResponseLinkedStorageError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HeaderField. +func (h HeaderField) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "key", h.HeaderFieldName) + populate(objectMap, "value", h.HeaderFieldValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HeaderField. +func (h *HeaderField) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "HeaderFieldName", &h.HeaderFieldName) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "HeaderFieldValue", &h.HeaderFieldValue) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diagnosticcontext": + err = unpopulate(val, "Diagnosticcontext", &i.Diagnosticcontext) + delete(rawMsg, key) + case "time": + err = unpopulateTimeRFC3339(val, "Time", &i.Time) + delete(rawMsg, key) + } + if err != nil { + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InnerErrorTrace. +func (i *InnerErrorTrace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "trace": + err = unpopulate(val, "Trace", &i.Trace) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LinkedStorageAccountsProperties. +func (l LinkedStorageAccountsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "linkedStorageAccount", l.LinkedStorageAccount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedStorageAccountsProperties. +func (l *LinkedStorageAccountsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "linkedStorageAccount": + err = unpopulate(val, "LinkedStorageAccount", &l.LinkedStorageAccount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LiveTokenResponse. +func (l LiveTokenResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "liveToken", l.LiveToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LiveTokenResponse. +func (l *LiveTokenResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "liveToken": + err = unpopulate(val, "LiveToken", &l.LiveToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbook. +func (m MyWorkbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbook. +func (m *MyWorkbook) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbookError. +func (m MyWorkbookError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", m.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookError. +func (m *MyWorkbookError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbookManagedIdentity. +func (m MyWorkbookManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookManagedIdentity. +func (m *MyWorkbookManagedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbookProperties. +func (m MyWorkbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", m.Category) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "serializedData", m.SerializedData) + populate(objectMap, "sourceId", m.SourceID) + populate(objectMap, "storageUri", m.StorageURI) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "timeModified", m.TimeModified) + populate(objectMap, "userId", m.UserID) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookProperties. +func (m *MyWorkbookProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &m.Category) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "serializedData": + err = unpopulate(val, "SerializedData", &m.SerializedData) + delete(rawMsg, key) + case "sourceId": + err = unpopulate(val, "SourceID", &m.SourceID) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &m.StorageURI) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "timeModified": + err = unpopulate(val, "TimeModified", &m.TimeModified) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &m.UserID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbookResource. +func (m MyWorkbookResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookResource. +func (m *MyWorkbookResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MyWorkbookUserAssignedIdentities. +func (m MyWorkbookUserAssignedIdentities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbookUserAssignedIdentities. +func (m *MyWorkbookUserAssignedIdentities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MyWorkbooksListResult. +func (m *MyWorkbooksListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationInfo. +func (o OperationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationInfo. +func (o *OperationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationLive. +func (o OperationLive) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", &o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLive. +func (o *OperationLive) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationsListResult. +func (o *OperationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkScopedResource. +func (p PrivateLinkScopedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ResourceId", p.ResourceID) + populate(objectMap, "ScopeId", p.ScopeID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkScopedResource. +func (p *PrivateLinkScopedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ResourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) + delete(rawMsg, key) + case "ScopeId": + err = unpopulate(val, "ScopeID", &p.ScopeID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagsResource. +func (t TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagsResource. +func (t *TagsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTest. +func (w WebTest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTest. +func (w *WebTest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestGeolocation. +func (w WebTestGeolocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Id", w.Location) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestGeolocation. +func (w *WebTestGeolocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Id": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestListResult. +func (w *WebTestListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestLocationsListResult. +func (w *WebTestLocationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestProperties. +func (w WebTestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "Configuration", w.Configuration) + populate(objectMap, "Description", w.Description) + populate(objectMap, "Enabled", w.Enabled) + populate(objectMap, "Frequency", w.Frequency) + populate(objectMap, "Locations", w.Locations) + populate(objectMap, "provisioningState", w.ProvisioningState) + populate(objectMap, "Request", w.Request) + populate(objectMap, "RetryEnabled", w.RetryEnabled) + populate(objectMap, "SyntheticMonitorId", w.SyntheticMonitorID) + populate(objectMap, "Timeout", w.Timeout) + populate(objectMap, "ValidationRules", w.ValidationRules) + populate(objectMap, "Kind", w.WebTestKind) + populate(objectMap, "Name", w.WebTestName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestProperties. +func (w *WebTestProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "Configuration": + err = unpopulate(val, "Configuration", &w.Configuration) + delete(rawMsg, key) + case "Description": + err = unpopulate(val, "Description", &w.Description) + delete(rawMsg, key) + case "Enabled": + err = unpopulate(val, "Enabled", &w.Enabled) + delete(rawMsg, key) + case "Frequency": + err = unpopulate(val, "Frequency", &w.Frequency) + delete(rawMsg, key) + case "Locations": + err = unpopulate(val, "Locations", &w.Locations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &w.ProvisioningState) + delete(rawMsg, key) + case "Request": + err = unpopulate(val, "Request", &w.Request) + delete(rawMsg, key) + case "RetryEnabled": + err = unpopulate(val, "RetryEnabled", &w.RetryEnabled) + delete(rawMsg, key) + case "SyntheticMonitorId": + err = unpopulate(val, "SyntheticMonitorID", &w.SyntheticMonitorID) + delete(rawMsg, key) + case "Timeout": + err = unpopulate(val, "Timeout", &w.Timeout) + delete(rawMsg, key) + case "ValidationRules": + err = unpopulate(val, "ValidationRules", &w.ValidationRules) + delete(rawMsg, key) + case "Kind": + err = unpopulate(val, "WebTestKind", &w.WebTestKind) + delete(rawMsg, key) + case "Name": + err = unpopulate(val, "WebTestName", &w.WebTestName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestPropertiesConfiguration. +func (w WebTestPropertiesConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "WebTest", w.WebTest) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestPropertiesConfiguration. +func (w *WebTestPropertiesConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "WebTest": + err = unpopulate(val, "WebTest", &w.WebTest) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestPropertiesRequest. +func (w WebTestPropertiesRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "FollowRedirects", w.FollowRedirects) + populate(objectMap, "HttpVerb", w.HTTPVerb) + populate(objectMap, "Headers", w.Headers) + populate(objectMap, "ParseDependentRequests", w.ParseDependentRequests) + populate(objectMap, "RequestBody", w.RequestBody) + populate(objectMap, "RequestUrl", w.RequestURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestPropertiesRequest. +func (w *WebTestPropertiesRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "FollowRedirects": + err = unpopulate(val, "FollowRedirects", &w.FollowRedirects) + delete(rawMsg, key) + case "HttpVerb": + err = unpopulate(val, "HTTPVerb", &w.HTTPVerb) + delete(rawMsg, key) + case "Headers": + err = unpopulate(val, "Headers", &w.Headers) + delete(rawMsg, key) + case "ParseDependentRequests": + err = unpopulate(val, "ParseDependentRequests", &w.ParseDependentRequests) + delete(rawMsg, key) + case "RequestBody": + err = unpopulate(val, "RequestBody", &w.RequestBody) + delete(rawMsg, key) + case "RequestUrl": + err = unpopulate(val, "RequestURL", &w.RequestURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestPropertiesValidationRules. +func (w WebTestPropertiesValidationRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ContentValidation", w.ContentValidation) + populate(objectMap, "ExpectedHttpStatusCode", w.ExpectedHTTPStatusCode) + populate(objectMap, "IgnoreHttpsStatusCode", w.IgnoreHTTPSStatusCode) + populate(objectMap, "SSLCertRemainingLifetimeCheck", w.SSLCertRemainingLifetimeCheck) + populate(objectMap, "SSLCheck", w.SSLCheck) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestPropertiesValidationRules. +func (w *WebTestPropertiesValidationRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ContentValidation": + err = unpopulate(val, "ContentValidation", &w.ContentValidation) + delete(rawMsg, key) + case "ExpectedHttpStatusCode": + err = unpopulate(val, "ExpectedHTTPStatusCode", &w.ExpectedHTTPStatusCode) + delete(rawMsg, key) + case "IgnoreHttpsStatusCode": + err = unpopulate(val, "IgnoreHTTPSStatusCode", &w.IgnoreHTTPSStatusCode) + delete(rawMsg, key) + case "SSLCertRemainingLifetimeCheck": + err = unpopulate(val, "SSLCertRemainingLifetimeCheck", &w.SSLCertRemainingLifetimeCheck) + delete(rawMsg, key) + case "SSLCheck": + err = unpopulate(val, "SSLCheck", &w.SSLCheck) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebTestPropertiesValidationRulesContentValidation. +func (w WebTestPropertiesValidationRulesContentValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ContentMatch", w.ContentMatch) + populate(objectMap, "IgnoreCase", w.IgnoreCase) + populate(objectMap, "PassIfTextFound", w.PassIfTextFound) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebTestPropertiesValidationRulesContentValidation. +func (w *WebTestPropertiesValidationRulesContentValidation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ContentMatch": + err = unpopulate(val, "ContentMatch", &w.ContentMatch) + delete(rawMsg, key) + case "IgnoreCase": + err = unpopulate(val, "IgnoreCase", &w.IgnoreCase) + delete(rawMsg, key) + case "PassIfTextFound": + err = unpopulate(val, "PassIfTextFound", &w.PassIfTextFound) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebtestsResource. +func (w WebtestsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebtestsResource. +func (w *WebtestsResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkItemConfiguration. +func (w WorkItemConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ConfigDisplayName", w.ConfigDisplayName) + populate(objectMap, "ConfigProperties", w.ConfigProperties) + populate(objectMap, "ConnectorId", w.ConnectorID) + populate(objectMap, "Id", w.ID) + populate(objectMap, "IsDefault", w.IsDefault) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfiguration. +func (w *WorkItemConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ConfigDisplayName": + err = unpopulate(val, "ConfigDisplayName", &w.ConfigDisplayName) + delete(rawMsg, key) + case "ConfigProperties": + err = unpopulate(val, "ConfigProperties", &w.ConfigProperties) + delete(rawMsg, key) + case "ConnectorId": + err = unpopulate(val, "ConnectorID", &w.ConnectorID) + delete(rawMsg, key) + case "Id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "IsDefault": + err = unpopulate(val, "IsDefault", &w.IsDefault) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkItemConfigurationError. +func (w WorkItemConfigurationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", w.Code) + populate(objectMap, "innererror", w.Innererror) + populate(objectMap, "message", w.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfigurationError. +func (w *WorkItemConfigurationError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &w.Code) + delete(rawMsg, key) + case "innererror": + err = unpopulate(val, "Innererror", &w.Innererror) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &w.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemConfigurationsListResult. +func (w *WorkItemConfigurationsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkItemCreateConfiguration. +func (w WorkItemCreateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ConnectorDataConfiguration", w.ConnectorDataConfiguration) + populate(objectMap, "ConnectorId", w.ConnectorID) + populate(objectMap, "ValidateOnly", w.ValidateOnly) + populate(objectMap, "WorkItemProperties", w.WorkItemProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkItemCreateConfiguration. +func (w *WorkItemCreateConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ConnectorDataConfiguration": + err = unpopulate(val, "ConnectorDataConfiguration", &w.ConnectorDataConfiguration) + delete(rawMsg, key) + case "ConnectorId": + err = unpopulate(val, "ConnectorID", &w.ConnectorID) + delete(rawMsg, key) + case "ValidateOnly": + err = unpopulate(val, "ValidateOnly", &w.ValidateOnly) + delete(rawMsg, key) + case "WorkItemProperties": + err = unpopulate(val, "WorkItemProperties", &w.WorkItemProperties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Workbook. +func (w Workbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Workbook. +func (w *Workbook) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &w.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookError. +func (w WorkbookError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", w.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookError. +func (w *WorkbookError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &w.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookErrorDefinition. +func (w WorkbookErrorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", w.Code) + populate(objectMap, "innerError", &w.InnerError) + populate(objectMap, "message", w.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookErrorDefinition. +func (w *WorkbookErrorDefinition) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &w.Code) + delete(rawMsg, key) + case "innerError": + err = unpopulate(val, "InnerError", &w.InnerError) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &w.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookInnerErrorTrace. +func (w *WorkbookInnerErrorTrace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "trace": + err = unpopulate(val, "Trace", &w.Trace) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookProperties. +func (w WorkbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", w.Category) + populate(objectMap, "description", w.Description) + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "revision", w.Revision) + populate(objectMap, "serializedData", w.SerializedData) + populate(objectMap, "sourceId", w.SourceID) + populate(objectMap, "storageUri", w.StorageURI) + populate(objectMap, "tags", w.Tags) + populateTimeRFC3339(objectMap, "timeModified", w.TimeModified) + populate(objectMap, "userId", w.UserID) + populate(objectMap, "version", w.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookProperties. +func (w *WorkbookProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &w.Category) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &w.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &w.Revision) + delete(rawMsg, key) + case "serializedData": + err = unpopulate(val, "SerializedData", &w.SerializedData) + delete(rawMsg, key) + case "sourceId": + err = unpopulate(val, "SourceID", &w.SourceID) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &w.StorageURI) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "timeModified": + err = unpopulateTimeRFC3339(val, "TimeModified", &w.TimeModified) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &w.UserID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &w.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookPropertiesUpdateParameters. +func (w WorkbookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", w.Category) + populate(objectMap, "description", w.Description) + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "revision", w.Revision) + populate(objectMap, "serializedData", w.SerializedData) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookPropertiesUpdateParameters. +func (w *WorkbookPropertiesUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &w.Category) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &w.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &w.DisplayName) + delete(rawMsg, key) + case "revision": + err = unpopulate(val, "Revision", &w.Revision) + delete(rawMsg, key) + case "serializedData": + err = unpopulate(val, "SerializedData", &w.SerializedData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookResource. +func (w WorkbookResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookResource. +func (w *WorkbookResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &w.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &w.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookResourceIdentity. +func (w WorkbookResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", w.PrincipalID) + populate(objectMap, "tenantId", w.TenantID) + populate(objectMap, "type", w.Type) + populate(objectMap, "userAssignedIdentities", w.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookResourceIdentity. +func (w *WorkbookResourceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &w.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &w.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &w.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplate. +func (w WorkbookTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplate. +func (w *WorkbookTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateError. +func (w WorkbookTemplateError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", w.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateError. +func (w *WorkbookTemplateError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &w.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateErrorBody. +func (w *WorkbookTemplateErrorBody) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &w.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &w.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &w.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateErrorFieldContract. +func (w WorkbookTemplateErrorFieldContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", w.Code) + populate(objectMap, "message", w.Message) + populate(objectMap, "target", w.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateErrorFieldContract. +func (w *WorkbookTemplateErrorFieldContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &w.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &w.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &w.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateGallery. +func (w WorkbookTemplateGallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", w.Category) + populate(objectMap, "name", w.Name) + populate(objectMap, "order", w.Order) + populate(objectMap, "resourceType", w.ResourceType) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateGallery. +func (w *WorkbookTemplateGallery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &w.Category) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &w.Order) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &w.ResourceType) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateLocalizedGallery. +func (w WorkbookTemplateLocalizedGallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "galleries", w.Galleries) + populate(objectMap, "templateData", &w.TemplateData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateLocalizedGallery. +func (w *WorkbookTemplateLocalizedGallery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "galleries": + err = unpopulate(val, "Galleries", &w.Galleries) + delete(rawMsg, key) + case "templateData": + err = unpopulate(val, "TemplateData", &w.TemplateData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateProperties. +func (w WorkbookTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", w.Author) + populate(objectMap, "galleries", w.Galleries) + populate(objectMap, "localized", w.Localized) + populate(objectMap, "priority", w.Priority) + populate(objectMap, "templateData", &w.TemplateData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateProperties. +func (w *WorkbookTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &w.Author) + delete(rawMsg, key) + case "galleries": + err = unpopulate(val, "Galleries", &w.Galleries) + delete(rawMsg, key) + case "localized": + err = unpopulate(val, "Localized", &w.Localized) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, "Priority", &w.Priority) + delete(rawMsg, key) + case "templateData": + err = unpopulate(val, "TemplateData", &w.TemplateData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateResource. +func (w WorkbookTemplateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", w.ID) + populate(objectMap, "location", w.Location) + populate(objectMap, "name", w.Name) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateResource. +func (w *WorkbookTemplateResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &w.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateUpdateParameters. +func (w WorkbookTemplateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplateUpdateParameters. +func (w *WorkbookTemplateUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookTemplatesListResult. +func (w *WorkbookTemplatesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkbookUpdateParameters. +func (w WorkbookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookUpdateParameters. +func (w *WorkbookUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &w.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &w.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbooksListResult. +func (w *WorkbooksListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + 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/myworkbooks_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/myworkbooks_client.go index 827720d1fe73..bcf316c1fda2 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_myworkbooks_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/myworkbooks_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/operations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/operations_client.go new file mode 100644 index 000000000000..00a5b0fc3b24 --- /dev/null +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/operations_client.go @@ -0,0 +1,105 @@ +//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. +// DO NOT EDIT. + +package armapplicationinsights + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + host string + pl runtime.Pipeline +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &OperationsClient{ + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists all of the available insights REST API operations. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-03-08 +// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Insights/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-03-08") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { + result := OperationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { + return OperationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/proactivedetectionconfigurations_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/proactivedetectionconfigurations_client.go index 57bee9c700b7..3e7b240d9514 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_proactivedetectionconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/proactivedetectionconfigurations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_response_types.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/response_types.go similarity index 98% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_response_types.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/response_types.go index eccfe8c931d1..add0d2699fd0 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_response_types.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/response_types.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -244,6 +245,11 @@ type MyWorkbooksClientUpdateResponse struct { MyWorkbook } +// OperationsClientListResponse contains the response from method OperationsClient.List. +type OperationsClientListResponse struct { + OperationListResult +} + // ProactiveDetectionConfigurationsClientGetResponse contains the response from method ProactiveDetectionConfigurationsClient.Get. type ProactiveDetectionConfigurationsClientGetResponse struct { ComponentProactiveDetectionConfiguration diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/time_rfc3339.go index 1b33cb686760..b9340f8953a0 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/time_rfc3339.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/webtestlocations_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/webtestlocations_client.go index f74c61564577..060c7508e5be 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtestlocations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/webtestlocations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/webtests_client.go similarity index 94% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/webtests_client.go index f65821d7dccc..70c22bd2e25e 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_webtests_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/webtests_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -56,9 +57,9 @@ 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 +// Generated from API version 2022-06-15 // resourceGroupName - The name of the resource group. The name is case insensitive. -// webTestName - The name of the Application Insights webtest resource. +// 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. // options - WebTestsClientCreateOrUpdateOptions contains the optional parameters for the WebTestsClient.CreateOrUpdate method. func (client *WebTestsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, webTestName string, webTestDefinition WebTest, options *WebTestsClientCreateOrUpdateOptions) (WebTestsClientCreateOrUpdateResponse, error) { @@ -96,7 +97,7 @@ func (client *WebTestsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, webTestDefinition) @@ -113,9 +114,9 @@ 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 +// Generated from API version 2022-06-15 // resourceGroupName - The name of the resource group. The name is case insensitive. -// webTestName - The name of the Application Insights webtest resource. +// webTestName - The name of the Application Insights WebTest resource. // options - WebTestsClientDeleteOptions contains the optional parameters for the WebTestsClient.Delete method. func (client *WebTestsClient) Delete(ctx context.Context, resourceGroupName string, webTestName string, options *WebTestsClientDeleteOptions) (WebTestsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, webTestName, options) @@ -152,16 +153,16 @@ func (client *WebTestsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // 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 +// Generated from API version 2022-06-15 // resourceGroupName - The name of the resource group. The name is case insensitive. -// webTestName - The name of the Application Insights webtest resource. +// webTestName - The name of the Application Insights WebTest resource. // options - WebTestsClientGetOptions contains the optional parameters for the WebTestsClient.Get method. func (client *WebTestsClient) Get(ctx context.Context, resourceGroupName string, webTestName string, options *WebTestsClientGetOptions) (WebTestsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, webTestName, options) @@ -198,7 +199,7 @@ func (client *WebTestsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,9 +214,9 @@ func (client *WebTestsClient) getHandleResponse(resp *http.Response) (WebTestsCl return result, nil } -// NewListPager - Get all Application Insights web test alerts definitions within a subscription. +// NewListPager - Get all Application Insights web test definitions for the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2015-05-01 +// Generated from API version 2022-06-15 // options - WebTestsClientListOptions contains the optional parameters for the WebTestsClient.List method. func (client *WebTestsClient) NewListPager(options *WebTestsClientListOptions) *runtime.Pager[WebTestsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WebTestsClientListResponse]{ @@ -257,7 +258,7 @@ func (client *WebTestsClient) listCreateRequest(ctx context.Context, options *We return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +275,7 @@ 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 +// Generated from API version 2022-06-15 // 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 @@ -327,7 +328,7 @@ func (client *WebTestsClient) listByComponentCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,9 +343,9 @@ func (client *WebTestsClient) listByComponentHandleResponse(resp *http.Response) return result, nil } -// NewListByResourceGroupPager - Get all Application Insights web tests defined within a specified resource group. +// NewListByResourceGroupPager - Get all Application Insights web tests defined for the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2015-05-01 +// Generated from API version 2022-06-15 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WebTestsClientListByResourceGroupOptions contains the optional parameters for the WebTestsClient.ListByResourceGroup // method. @@ -392,7 +393,7 @@ func (client *WebTestsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,12 +408,12 @@ func (client *WebTestsClient) listByResourceGroupHandleResponse(resp *http.Respo return result, nil } -// UpdateTags - Creates or updates an Application Insights web test definition. +// UpdateTags - Updates the tags associated with an Application Insights web test. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2015-05-01 +// Generated from API version 2022-06-15 // 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. +// webTestName - The name of the Application Insights WebTest resource. +// webTestTags - Updated tag information to associate with the web test resource. // options - WebTestsClientUpdateTagsOptions contains the optional parameters for the WebTestsClient.UpdateTags method. func (client *WebTestsClient) UpdateTags(ctx context.Context, resourceGroupName string, webTestName string, webTestTags TagsResource, options *WebTestsClientUpdateTagsOptions) (WebTestsClientUpdateTagsResponse, error) { req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, webTestName, webTestTags, options) @@ -449,7 +450,7 @@ func (client *WebTestsClient) updateTagsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-05-01") + reqQP.Set("api-version", "2022-06-15") req.Raw().URL.RawQuery = reqQP.Encode() 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/workbooks_client.go similarity index 97% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/workbooks_client.go index 2b1690ce5b0a..f8361befb84d 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooks_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/workbooks_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -501,9 +502,10 @@ func (client *WorkbooksClient) revisionsListHandleResponse(resp *http.Response) // Generated from API version 2022-04-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // resourceName - The name of the resource. +// workbookUpdateParameters - Properties that need to be specified to create a new workbook. // 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) +func (client *WorkbooksClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookUpdateParameters WorkbookUpdateParameters, options *WorkbooksClientUpdateOptions) (WorkbooksClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, workbookUpdateParameters, options) if err != nil { return WorkbooksClientUpdateResponse{}, err } @@ -518,7 +520,7 @@ func (client *WorkbooksClient) Update(ctx context.Context, resourceGroupName str } // updateCreateRequest creates the Update request. -func (client *WorkbooksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbooksClientUpdateOptions) (*policy.Request, error) { +func (client *WorkbooksClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, workbookUpdateParameters WorkbookUpdateParameters, options *WorkbooksClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -543,10 +545,7 @@ func (client *WorkbooksClient) updateCreateRequest(ctx context.Context, resource reqQP.Set("api-version", "2022-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.WorkbookUpdateParameters != nil { - return req, runtime.MarshalAsJSON(req, *options.WorkbookUpdateParameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, workbookUpdateParameters) } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/workbooktemplates_client.go similarity index 96% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/workbooktemplates_client.go index b6817ad082fe..cbd6ae5ae5c2 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workbooktemplates_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/workbooktemplates_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights @@ -280,10 +281,11 @@ func (client *WorkbookTemplatesClient) listByResourceGroupHandleResponse(resp *h // 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. +// workbookTemplateUpdateParameters - Properties that need to be specified to patch a workbook template. // options - WorkbookTemplatesClientUpdateOptions contains the optional parameters for the WorkbookTemplatesClient.Update // method. -func (client *WorkbookTemplatesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbookTemplatesClientUpdateOptions) (WorkbookTemplatesClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, options) +func (client *WorkbookTemplatesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, workbookTemplateUpdateParameters WorkbookTemplateUpdateParameters, options *WorkbookTemplatesClientUpdateOptions) (WorkbookTemplatesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, workbookTemplateUpdateParameters, options) if err != nil { return WorkbookTemplatesClientUpdateResponse{}, err } @@ -298,7 +300,7 @@ func (client *WorkbookTemplatesClient) Update(ctx context.Context, resourceGroup } // updateCreateRequest creates the Update request. -func (client *WorkbookTemplatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *WorkbookTemplatesClientUpdateOptions) (*policy.Request, error) { +func (client *WorkbookTemplatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, workbookTemplateUpdateParameters WorkbookTemplateUpdateParameters, options *WorkbookTemplatesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -320,10 +322,7 @@ func (client *WorkbookTemplatesClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2020-11-20") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.WorkbookTemplateUpdateParameters != nil { - return req, runtime.MarshalAsJSON(req, *options.WorkbookTemplateUpdateParameters) - } - return req, nil + return req, runtime.MarshalAsJSON(req, workbookTemplateUpdateParameters) } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/workitemconfigurations_client.go similarity index 99% rename from sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go rename to sdk/resourcemanager/applicationinsights/armapplicationinsights/workitemconfigurations_client.go index 5dcd48847dda..8bbf1ef10391 100644 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_workitemconfigurations_client.go +++ b/sdk/resourcemanager/applicationinsights/armapplicationinsights/workitemconfigurations_client.go @@ -5,6 +5,7 @@ // 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. +// DO NOT EDIT. package armapplicationinsights 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 6de4f1c15e89..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.ItemScopePathAnalyticsItems, - &armapplicationinsights.AnalyticsItemsClientGetOptions{ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"), - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.ItemScopePathAnalyticsItems, - armapplicationinsights.ComponentAnalyticsItem{ - Content: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), - Name: to.Ptr("Exceptions - New in the last 24 hours"), - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.ItemScopePathAnalyticsItems, - &armapplicationinsights.AnalyticsItemsClientDeleteOptions{ID: to.Ptr("3466c160-4a10-4df8-afdf-0007f3f6dee5"), - 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 e5e59e565fcb..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_annotations_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" - - "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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("my-resource-group", - "my-component", - "2018-02-05T00%253A30%253A00.000Z", - "2018-02-06T00%253A33A00.000Z", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.Annotation{ - AnnotationName: to.Ptr("TestAnnotation"), - Category: to.Ptr("Text"), - EventTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-31T13:41:38.657Z"); return t }()), - ID: to.Ptr("444e2c08-274a-4bbb-a89e-d77bb720f44a"), - Properties: to.Ptr("{\"Comments\":\"Testing\",\"Label\":\"Success\"}"), - }, - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-component", - "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - "444e2c08-274a-4bbb-a89e-d77bb720f44a", - 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 195f391adccf..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_apikeys_client_test.go +++ /dev/null @@ -1,120 +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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("my-resource-group", - "my-component", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.APIKeyRequest{ - Name: to.Ptr("test2"), - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, - "my-resource-group", - "my-component", - "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - "bb820f1b-3110-4a8b-ba2c-8c1129d7eb6a", - 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 e9da868e8f79..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - 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 61a1e7604c2c..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "my-resource-group", - "my-component", - 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 fb97f2713497..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - 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 a51f10619984..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/v2" -) - -// 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("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "someResourceGroupName", - "myComponent", - 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("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateAndUpdate(ctx, - "someResourceGroupName", - "myComponent", - armapplicationinsights.StorageTypeServiceProfiler, - armapplicationinsights.ComponentLinkedStorageAccounts{ - Properties: &armapplicationinsights.LinkedStorageAccountsProperties{ - LinkedStorageAccount: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname"), - }, - }, - 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("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "someResourceGroupName", - "myComponent", - armapplicationinsights.StorageTypeServiceProfiler, - armapplicationinsights.ComponentLinkedStorageAccountsPatch{ - Properties: &armapplicationinsights.LinkedStorageAccountsProperties{ - LinkedStorageAccount: to.Ptr("/subscriptions/86dc51d3-92ed-4d7e-947a-775ea79b4918/resourceGroups/someResourceGroupName/providers/Microsoft.Storage/storageAccounts/storageaccountname"), - }, - }, - 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("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "someResourceGroupName", - "myComponent", - 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 ec38b841bc27..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - 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 b81ee90608e0..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_components_client_test.go +++ /dev/null @@ -1,224 +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/v2" -) - -// 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("subid", 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) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("my-resource-group", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.Component{ - Location: to.Ptr("South Central US"), - Kind: to.Ptr("web"), - Properties: &armapplicationinsights.ComponentProperties{ - ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb), - FlowType: to.Ptr(armapplicationinsights.FlowTypeBluefield), - RequestSource: to.Ptr(armapplicationinsights.RequestSourceRest), - WorkspaceResourceID: to.Ptr("/subscriptions/subid/resourcegroups/my-resource-group/providers/microsoft.operationalinsights/workspaces/my-workspace"), - }, - }, - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "my-resource-group", - "my-component", - 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("00000000-0000-0000-0000-00000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Purge(ctx, - "OIAutoRest5123", - "aztest5048", - armapplicationinsights.ComponentPurgeBody{ - Filters: []*armapplicationinsights.ComponentPurgeBodyFilters{ - { - Column: to.Ptr("TimeGenerated"), - Operator: to.Ptr(">"), - Value: "2017-09-01T00:00:00", - }}, - Table: to.Ptr("Heartbeat"), - }, - 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("00000000-0000-0000-0000-00000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPurgeStatus(ctx, - "OIAutoRest5123", - "aztest5048", - "purge-970318e7-b859-4edb-8903-83b1b54d0b74", - 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 faa387cd0051..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.ComponentExportRequest{ - DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), - DestinationAddress: to.Ptr("https://mystorageblob.blob.core.windows.net/testexport?sv=2015-04-05&sr=c&sig=token"), - DestinationStorageLocationID: to.Ptr("eastus"), - DestinationStorageSubscriptionID: to.Ptr("subid"), - DestinationType: to.Ptr("Blob"), - IsEnabled: to.Ptr("true"), - NotificationQueueEnabled: to.Ptr("false"), - NotificationQueueURI: to.Ptr(""), - RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"), - }, - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Delete(ctx, - "my-resource-group", - "my-component", - "uGOoki0jQsyEs3IdQ83Q4QsNr4=", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - "uGOoki0jQsyEs3IdQ83Q4QsNr4=", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "my-resource-group", - "my-component", - "uGOoki0jQsyEs3IdQ83Q4QsNr4=", - armapplicationinsights.ComponentExportRequest{ - DestinationAccountID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.ClassicStorage/storageAccounts/mystorageblob"), - DestinationAddress: to.Ptr("https://mystorageblob.blob.core.windows.net/fchentest?sv=2015-04-05&sr=c&sig=token"), - DestinationStorageLocationID: to.Ptr("eastus"), - DestinationStorageSubscriptionID: to.Ptr("subid"), - DestinationType: to.Ptr("Blob"), - IsEnabled: to.Ptr("true"), - NotificationQueueEnabled: to.Ptr("false"), - NotificationQueueURI: to.Ptr(""), - RecordTypes: to.Ptr("Requests, Event, Exceptions, Metrics, PageViews, PageViewPerformance, Rdd, PerformanceCounters, Availability"), - }, - 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 50424ce908fe..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "my-resource-group", - "my-ai-component", - &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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-ai-component", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Add(ctx, - "my-resource-group", - "my-ai-component", - "deadb33f-8bee-4d3b-a059-9be8dac93960", - armapplicationinsights.ComponentFavorite{ - Config: to.Ptr("{\"MEDataModelRawJSON\":\"{\\n \\\"version\\\": \\\"1.4.1\\\",\\n \\\"isCustomDataModel\\\": true,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\n \\\"chartType\\\": \\\"Area\\\",\\n \\\"chartHeight\\\": 4,\\n \\\"metrics\\\": [\\n {\\n \\\"id\\\": \\\"preview/requests/count\\\",\\n \\\"metricAggregation\\\": \\\"Sum\\\",\\n \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n }\\n ],\\n \\\"priorPeriod\\\": false,\\n \\\"clickAction\\\": {\\n \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n },\\n \\\"horizontalBars\\\": true,\\n \\\"showOther\\\": true,\\n \\\"aggregation\\\": \\\"Sum\\\",\\n \\\"percentage\\\": false,\\n \\\"palette\\\": \\\"fail\\\",\\n \\\"yAxisOption\\\": 0,\\n \\\"title\\\": \\\"\\\"\\n },\\n {\\n \\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\n \\\"chartType\\\": \\\"Area\\\",\\n \\\"chartHeight\\\": 2,\\n \\\"metrics\\\": [\\n {\\n \\\"id\\\": \\\"preview/requests/duration\\\",\\n \\\"metricAggregation\\\": \\\"Avg\\\",\\n \\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"\\n }\\n ],\\n \\\"priorPeriod\\\": false,\\n \\\"clickAction\\\": {\\n \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n },\\n \\\"horizontalBars\\\": true,\\n \\\"showOther\\\": true,\\n \\\"aggregation\\\": \\\"Avg\\\",\\n \\\"percentage\\\": false,\\n \\\"palette\\\": \\\"greenHues\\\",\\n \\\"yAxisOption\\\": 0,\\n \\\"title\\\": \\\"\\\"\\n },\\n {\\n \\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\n \\\"chartType\\\": \\\"Bar\\\",\\n \\\"chartHeight\\\": 4,\\n \\\"metrics\\\": [\\n {\\n \\\"id\\\": \\\"preview/requests/duration\\\",\\n \\\"metricAggregation\\\": \\\"Avg\\\",\\n \\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"\\n }\\n ],\\n \\\"priorPeriod\\\": false,\\n \\\"clickAction\\\": {\\n \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n },\\n \\\"horizontalBars\\\": true,\\n \\\"showOther\\\": true,\\n \\\"aggregation\\\": \\\"Avg\\\",\\n \\\"percentage\\\": false,\\n \\\"palette\\\": \\\"magentaHues\\\",\\n \\\"yAxisOption\\\": 0,\\n \\\"title\\\": \\\"\\\"\\n },\\n {\\n \\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\n \\\"grouping\\\": {\\n \\\"kind\\\": \\\"ByDimension\\\",\\n \\\"dimension\\\": \\\"context.application.version\\\"\\n },\\n \\\"chartType\\\": \\\"Grid\\\",\\n \\\"chartHeight\\\": 1,\\n \\\"metrics\\\": [\\n {\\n \\\"id\\\": \\\"basicException.count\\\",\\n \\\"metricAggregation\\\": \\\"Sum\\\",\\n \\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"\\n },\\n {\\n \\\"id\\\": \\\"requestFailed.count\\\",\\n \\\"metricAggregation\\\": \\\"Sum\\\",\\n \\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"\\n }\\n ],\\n \\\"priorPeriod\\\": true,\\n \\\"clickAction\\\": {\\n \\\"defaultBlade\\\": \\\"SearchBlade\\\"\\n },\\n \\\"horizontalBars\\\": true,\\n \\\"showOther\\\": true,\\n \\\"percentage\\\": false,\\n \\\"palette\\\": \\\"blueHues\\\",\\n \\\"yAxisOption\\\": 0,\\n \\\"title\\\": \\\"\\\"\\n }\\n ],\\n \\\"currentFilter\\\": {\\n \\\"eventTypes\\\": [\\n 1,\\n 2\\n ],\\n \\\"typeFacets\\\": {},\\n \\\"isPermissive\\\": false\\n },\\n \\\"timeContext\\\": {\\n \\\"durationMs\\\": 75600000,\\n \\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\n \\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\n \\\"isInitialTime\\\": false,\\n \\\"grain\\\": 1,\\n \\\"useDashboardTimeRange\\\": false\\n },\\n \\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\n \\\"timeSource\\\": 0\\n}\"}"), - FavoriteID: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"), - FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared), - IsGeneratedFromTemplate: to.Ptr(false), - Name: to.Ptr("Blah Blah Blah"), - Tags: []*string{ - to.Ptr("TagSample01"), - to.Ptr("TagSample02")}, - Version: to.Ptr("ME"), - }, - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "my-resource-group", - "my-ai-component", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - armapplicationinsights.ComponentFavorite{ - Config: to.Ptr("{\"MEDataModelRawJSON\":\"{\\\"version\\\": \\\"1.4.1\\\",\\\"isCustomDataModel\\\": true,\\\"items\\\": [{\\\"id\\\": \\\"90a7134d-9a38-4c25-88d3-a495209873eb\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Sum\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"fail\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"0c289098-88e8-4010-b212-546815cddf70\\\",\\\"chartType\\\": \\\"Area\\\",\\\"chartHeight\\\": 2,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-j1\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"greenHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"cbdaab6f-a808-4f71-aca5-b3976cbb7345\\\",\\\"chartType\\\": \\\"Bar\\\",\\\"chartHeight\\\": 4,\\\"metrics\\\": [{\\\"id\\\": \\\"preview/requests/duration\\\",\\\"metricAggregation\\\": \\\"Avg\\\",\\\"color\\\": \\\"msportalfx-bgcolor-d0\\\"}],\\\"priorPeriod\\\": false,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"aggregation\\\": \\\"Avg\\\",\\\"percentage\\\": false,\\\"palette\\\": \\\"magentaHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"},{\\\"id\\\": \\\"1d5a6a3a-9fa1-4099-9cf9-05eff72d1b02\\\",\\\"grouping\\\": {\\\"kind\\\": \\\"ByDimension\\\",\\\"dimension\\\": \\\"context.application.version\\\"},\\\"chartType\\\": \\\"Grid\\\",\\\"chartHeight\\\": 1,\\\"metrics\\\": [{\\\"id\\\": \\\"basicException.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-g0\\\"},{\\\"id\\\": \\\"requestFailed.count\\\",\\\"metricAggregation\\\": \\\"Sum\\\",\\\"color\\\": \\\"msportalfx-bgcolor-f0s2\\\"}],\\\"priorPeriod\\\": true,\\\"clickAction\\\": {\\\"defaultBlade\\\": \\\"SearchBlade\\\"},\\\"horizontalBars\\\": true,\\\"showOther\\\": true,\\\"percentage\\\": false,\\\"palette\\\": \\\"blueHues\\\",\\\"yAxisOption\\\": 0,\\\"title\\\": \\\"\\\"}],\\\"currentFilter\\\": {\\\"eventTypes\\\": [1,2],\\\"typeFacets\\\": {},\\\"isPermissive\\\": false},\\\"timeContext\\\": {\\\"durationMs\\\": 75600000,\\\"endTime\\\": \\\"2018-01-31T20:30:00.000Z\\\",\\\"createdTime\\\": \\\"2018-01-31T23:54:26.280Z\\\",\\\"isInitialTime\\\": false,\\\"grain\\\": 1,\\\"useDashboardTimeRange\\\": false},\\\"jsonUri\\\": \\\"Favorite_BlankChart\\\",\\\"timeSource\\\": 0}\"}"), - FavoriteID: to.Ptr("deadb33f-5e0d-4064-8ebb-1a4ed0313eb2"), - FavoriteType: to.Ptr(armapplicationinsights.FavoriteTypeShared), - IsGeneratedFromTemplate: to.Ptr(false), - Name: to.Ptr("Derek Changed This"), - Tags: []*string{ - to.Ptr("TagSample01"), - to.Ptr("TagSample02"), - to.Ptr("TagSample03")}, - TimeModified: to.Ptr("2018-02-02T18:39:11.6569686Z"), - Version: to.Ptr("ME"), - }, - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-ai-component", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - 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 6f4fffb65a30..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/v2" -) - -// 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, - "subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/FabrikamFiberApp/providers/microsoft.insights/components/CustomAvailabilityTest/providers/microsoft.insights/generatelivetoken", - 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 408e09292d7d..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_myworkbooks_client_test.go +++ /dev/null @@ -1,190 +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/v2" -) - -// 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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("my-resource-group", - 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) - } - 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("6b643656-33eb-422f-aee8-3ac145d124af", 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) - } - 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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - 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("00000000-0000-0000-0000-00000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "my-resource-group", - "deadb33f-8bee-4d3b-a059-9be8dac93960", - armapplicationinsights.MyWorkbook{ - Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"), - ID: to.Ptr("c0deea5e-3344-40f2-96f8-6f8e1c3b5722"), - Location: to.Ptr("west us"), - Tags: map[string]*string{ - "0": to.Ptr("TagSample01"), - "1": to.Ptr("TagSample02"), - }, - Kind: to.Ptr(armapplicationinsights.KindUser), - Properties: &armapplicationinsights.MyWorkbookProperties{ - Category: to.Ptr("workbook"), - DisplayName: to.Ptr("Blah Blah Blah"), - SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\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.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"), - SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"), - }, - }, - &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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - armapplicationinsights.MyWorkbook{ - Name: to.Ptr("deadb33f-8bee-4d3b-a059-9be8dac93960"), - Location: to.Ptr("west us"), - Tags: map[string]*string{ - "0": to.Ptr("TagSample01"), - "1": to.Ptr("TagSample02"), - }, - Kind: to.Ptr(armapplicationinsights.KindUser), - Properties: &armapplicationinsights.MyWorkbookProperties{ - Category: to.Ptr("workbook"), - DisplayName: to.Ptr("Blah Blah Blah"), - SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\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.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"), - SourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/MyGroup/providers/Microsoft.Web/sites/MyTestApp-CodeLens"), - Version: to.Ptr("ME"), - }, - }, - &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 309fd2be1e0c..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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-component", - "slowpageloadtime", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "my-resource-group", - "my-component", - "slowpageloadtime", - armapplicationinsights.ComponentProactiveDetectionConfiguration{ - CustomEmails: []*string{ - to.Ptr("foo@microsoft.com"), - to.Ptr("foo2@microsoft.com")}, - Enabled: to.Ptr(true), - Name: to.Ptr("slowpageloadtime"), - RuleDefinitions: &armapplicationinsights.ComponentProactiveDetectionConfigurationRuleDefinitions{ - Description: to.Ptr("Smart Detection rules notify you of performance anomaly issues."), - DisplayName: to.Ptr("Slow page load time"), - HelpURL: to.Ptr("https://docs.microsoft.com/en-us/azure/application-insights/app-insights-proactive-performance-diagnostics"), - IsEnabledByDefault: to.Ptr(true), - IsHidden: to.Ptr(false), - IsInPreview: to.Ptr(false), - Name: to.Ptr("slowpageloadtime"), - 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 223613101919..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtestlocations_client_test.go +++ /dev/null @@ -1,43 +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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("my-resource-group", - "my-component", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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 55bfa3afc174..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_webtests_client_test.go +++ /dev/null @@ -1,209 +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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("my-resource-group", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-webtest-01-mywebservice", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "my-resource-group", - "my-webtest-my-component", - armapplicationinsights.WebTest{ - Location: to.Ptr("South Central US"), - Kind: to.Ptr(armapplicationinsights.WebTestKindPing), - Properties: &armapplicationinsights.WebTestProperties{ - Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{ - WebTest: to.Ptr(""), - }, - Description: to.Ptr("Ping web test alert for mytestwebapp"), - Enabled: to.Ptr(true), - Frequency: to.Ptr[int32](900), - WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing), - Locations: []*armapplicationinsights.WebTestGeolocation{ - { - Location: to.Ptr("us-fl-mia-edge"), - }}, - WebTestName: to.Ptr("my-webtest-my-component"), - RetryEnabled: to.Ptr(true), - SyntheticMonitorID: to.Ptr("my-webtest-my-component"), - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateTags(ctx, - "my-resource-group", - "my-webtest-my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-webtest-01-mywebservice", - 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("subid", 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) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByComponentPager("my-component", - "my-resource-group", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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 cdff171fc6d7..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooks_client_test.go +++ /dev/null @@ -1,223 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", 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) - } - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("my-resource-group", - armapplicationinsights.CategoryTypeWorkbook, - &armapplicationinsights.WorkbooksClientListByResourceGroupOptions{Tags: []string{}, - SourceID: to.Ptr("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourceGroups/my-resource-group/providers/Microsoft.Web/sites/MyApp"), - CanFetchContent: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - &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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - armapplicationinsights.Workbook{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "TagSample01": to.Ptr("sample01"), - "TagSample02": to.Ptr("sample02"), - }, - Kind: to.Ptr(armapplicationinsights.WorkbookSharedTypeKindShared), - Properties: &armapplicationinsights.WorkbookProperties{ - Description: to.Ptr("Sample workbook"), - Category: to.Ptr("workbook"), - DisplayName: to.Ptr("Sample workbook"), - SerializedData: to.Ptr("{\"version\":\"Notebook/1.0\",\"items\":[{\"type\":1,\"content\":\"{\"json\":\"## New workbook\\r\\n---\\r\\n\\r\\nWelcome to your new workbook. This area will display text formatted as markdown.\\r\\n\\r\\n\\r\\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.\"}\",\"halfWidth\":null,\"conditionalVisibility\":null},{\"type\":3,\"content\":\"{\"version\":\"KqlItem/1.0\",\"query\":\"union withsource=TableName *\\n| summarize Count=count() by TableName\\n| render barchart\",\"showQuery\":false,\"size\":1,\"aggregation\":0,\"showAnnotations\":false}\",\"halfWidth\":null,\"conditionalVisibility\":null}],\"isLocked\":false}"), - }, - }, - &armapplicationinsights.WorkbooksClientCreateOrUpdateOptions{SourceID: to.Ptr("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/my-resource-group")}) - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - &armapplicationinsights.WorkbooksClientUpdateOptions{SourceID: to.Ptr("/subscriptions/6b643656-33eb-422f-aee8-3ac145d124af/resourcegroups/my-resource-group"), - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewRevisionsListPager("my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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/2022-04-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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RevisionGet(ctx, - "my-resource-group", - "deadb33f-5e0d-4064-8ebb-1a4ed0313eb2", - "1e2f8435b98248febee70c64ac22e1ab", - 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 7b20e4bd81d6..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workbooktemplates_client_test.go +++ /dev/null @@ -1,170 +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/v2" -) - -// 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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("my-resource-group", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "my-resource-group", - "my-resource-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/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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-template-resource", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "my-resource-group", - "testtemplate2", - armapplicationinsights.WorkbookTemplate{ - Location: to.Ptr("west us"), - Properties: &armapplicationinsights.WorkbookTemplateProperties{ - Author: to.Ptr("Contoso"), - Galleries: []*armapplicationinsights.WorkbookTemplateGallery{ - { - Name: to.Ptr("Simple Template"), - Type: to.Ptr("tsg"), - Category: to.Ptr("Failures"), - Order: to.Ptr[int32](100), - ResourceType: to.Ptr("microsoft.insights/components"), - }}, - 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("6b643656-33eb-422f-aee8-3ac145d124af", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "my-resource-group", - "my-template-resource", - &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 1393ff928899..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/ze_generated_example_workitemconfigurations_client_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/v2" -) - -// 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("my-resource-group", - "my-component", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "my-resource-group", - "my-component", - armapplicationinsights.WorkItemCreateConfiguration{ - ConnectorDataConfiguration: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}"), - ConnectorID: to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"), - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDefault(ctx, - "my-resource-group", - "my-component", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "my-resource-group", - "my-component", - "Visual Studio Team Services", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetItem(ctx, - "my-resource-group", - "my-component", - "Visual Studio Team Services", - 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("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UpdateItem(ctx, - "my-resource-group", - "my-component", - "Visual Studio Team Services", - armapplicationinsights.WorkItemCreateConfiguration{ - ConnectorDataConfiguration: to.Ptr("{\"VSOAccountBaseUrl\":\"https://testtodelete.visualstudio.com\",\"ProjectCollection\":\"DefaultCollection\",\"Project\":\"todeletefirst\",\"ResourceId\":\"d0662b05-439a-4a1b-840b-33a7f8b42ebf\",\"Custom\":\"{\\\"/fields/System.WorkItemType\\\":\\\"Bug\\\",\\\"/fields/System.AreaPath\\\":\\\"todeletefirst\\\",\\\"/fields/System.AssignedTo\\\":\\\"\\\"}\"}"), - ConnectorID: to.Ptr("d334e2a4-6733-488e-8645-a9fdc1694f41"), - 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_models_serde.go b/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go deleted file mode 100644 index e83bd08bb9d1..000000000000 --- a/sdk/resourcemanager/applicationinsights/armapplicationinsights/zz_generated_models_serde.go +++ /dev/null @@ -1,663 +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 - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type APIKeyRequest. -func (a APIKeyRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "linkedReadProperties", a.LinkedReadProperties) - populate(objectMap, "linkedWriteProperties", a.LinkedWriteProperties) - populate(objectMap, "name", a.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Annotation. -func (a Annotation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "AnnotationName", a.AnnotationName) - populate(objectMap, "Category", a.Category) - populateTimeRFC3339(objectMap, "EventTime", a.EventTime) - populate(objectMap, "Id", a.ID) - populate(objectMap, "Properties", a.Properties) - populate(objectMap, "RelatedAnnotation", a.RelatedAnnotation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Annotation. -func (a *Annotation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "AnnotationName": - err = unpopulate(val, "AnnotationName", &a.AnnotationName) - delete(rawMsg, key) - case "Category": - err = unpopulate(val, "Category", &a.Category) - delete(rawMsg, key) - case "EventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &a.EventTime) - delete(rawMsg, key) - case "Id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "Properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "RelatedAnnotation": - err = unpopulate(val, "RelatedAnnotation", &a.RelatedAnnotation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Component. -func (c Component) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentBillingFeatures. -func (c ComponentBillingFeatures) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "CurrentBillingFeatures", c.CurrentBillingFeatures) - populate(objectMap, "DataVolumeCap", c.DataVolumeCap) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentFavorite. -func (c ComponentFavorite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "Category", c.Category) - populate(objectMap, "Config", c.Config) - populate(objectMap, "FavoriteId", c.FavoriteID) - populate(objectMap, "FavoriteType", c.FavoriteType) - populate(objectMap, "IsGeneratedFromTemplate", c.IsGeneratedFromTemplate) - populate(objectMap, "Name", c.Name) - populate(objectMap, "SourceType", c.SourceType) - populate(objectMap, "Tags", c.Tags) - populate(objectMap, "TimeModified", c.TimeModified) - populate(objectMap, "UserId", c.UserID) - populate(objectMap, "Version", c.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentLinkedStorageAccountsPatch. -func (c ComponentLinkedStorageAccountsPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentProactiveDetectionConfiguration. -func (c ComponentProactiveDetectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "CustomEmails", c.CustomEmails) - populate(objectMap, "Enabled", c.Enabled) - populate(objectMap, "LastUpdatedTime", c.LastUpdatedTime) - populate(objectMap, "Name", c.Name) - populate(objectMap, "RuleDefinitions", c.RuleDefinitions) - populate(objectMap, "SendEmailsToSubscriptionOwners", c.SendEmailsToSubscriptionOwners) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentProperties. -func (c ComponentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "AppId", c.AppID) - populate(objectMap, "ApplicationId", c.ApplicationID) - populate(objectMap, "Application_Type", c.ApplicationType) - populate(objectMap, "ConnectionString", c.ConnectionString) - populateTimeRFC3339(objectMap, "CreationDate", c.CreationDate) - populate(objectMap, "DisableIpMasking", c.DisableIPMasking) - populate(objectMap, "DisableLocalAuth", c.DisableLocalAuth) - populate(objectMap, "Flow_Type", c.FlowType) - populate(objectMap, "ForceCustomerStorageForProfiler", c.ForceCustomerStorageForProfiler) - populate(objectMap, "HockeyAppId", c.HockeyAppID) - populate(objectMap, "HockeyAppToken", c.HockeyAppToken) - populate(objectMap, "ImmediatePurgeDataOn30Days", c.ImmediatePurgeDataOn30Days) - populate(objectMap, "IngestionMode", c.IngestionMode) - populate(objectMap, "InstrumentationKey", c.InstrumentationKey) - populateTimeRFC3339(objectMap, "LaMigrationDate", c.LaMigrationDate) - populate(objectMap, "Name", c.Name) - populate(objectMap, "PrivateLinkScopedResources", c.PrivateLinkScopedResources) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publicNetworkAccessForIngestion", c.PublicNetworkAccessForIngestion) - populate(objectMap, "publicNetworkAccessForQuery", c.PublicNetworkAccessForQuery) - populate(objectMap, "Request_Source", c.RequestSource) - populate(objectMap, "RetentionInDays", c.RetentionInDays) - populate(objectMap, "SamplingPercentage", c.SamplingPercentage) - populate(objectMap, "TenantId", c.TenantID) - populate(objectMap, "WorkspaceResourceId", c.WorkspaceResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentProperties. -func (c *ComponentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "AppId": - err = unpopulate(val, "AppID", &c.AppID) - delete(rawMsg, key) - case "ApplicationId": - err = unpopulate(val, "ApplicationID", &c.ApplicationID) - delete(rawMsg, key) - case "Application_Type": - err = unpopulate(val, "ApplicationType", &c.ApplicationType) - delete(rawMsg, key) - case "ConnectionString": - err = unpopulate(val, "ConnectionString", &c.ConnectionString) - delete(rawMsg, key) - case "CreationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &c.CreationDate) - delete(rawMsg, key) - case "DisableIpMasking": - err = unpopulate(val, "DisableIPMasking", &c.DisableIPMasking) - delete(rawMsg, key) - case "DisableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &c.DisableLocalAuth) - delete(rawMsg, key) - case "Flow_Type": - err = unpopulate(val, "FlowType", &c.FlowType) - delete(rawMsg, key) - case "ForceCustomerStorageForProfiler": - err = unpopulate(val, "ForceCustomerStorageForProfiler", &c.ForceCustomerStorageForProfiler) - delete(rawMsg, key) - case "HockeyAppId": - err = unpopulate(val, "HockeyAppID", &c.HockeyAppID) - delete(rawMsg, key) - case "HockeyAppToken": - err = unpopulate(val, "HockeyAppToken", &c.HockeyAppToken) - delete(rawMsg, key) - case "ImmediatePurgeDataOn30Days": - err = unpopulate(val, "ImmediatePurgeDataOn30Days", &c.ImmediatePurgeDataOn30Days) - delete(rawMsg, key) - case "IngestionMode": - err = unpopulate(val, "IngestionMode", &c.IngestionMode) - delete(rawMsg, key) - case "InstrumentationKey": - err = unpopulate(val, "InstrumentationKey", &c.InstrumentationKey) - delete(rawMsg, key) - case "LaMigrationDate": - err = unpopulateTimeRFC3339(val, "LaMigrationDate", &c.LaMigrationDate) - delete(rawMsg, key) - case "Name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "PrivateLinkScopedResources": - err = unpopulate(val, "PrivateLinkScopedResources", &c.PrivateLinkScopedResources) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccessForIngestion": - err = unpopulate(val, "PublicNetworkAccessForIngestion", &c.PublicNetworkAccessForIngestion) - delete(rawMsg, key) - case "publicNetworkAccessForQuery": - err = unpopulate(val, "PublicNetworkAccessForQuery", &c.PublicNetworkAccessForQuery) - delete(rawMsg, key) - case "Request_Source": - err = unpopulate(val, "RequestSource", &c.RequestSource) - delete(rawMsg, key) - case "RetentionInDays": - err = unpopulate(val, "RetentionInDays", &c.RetentionInDays) - delete(rawMsg, key) - case "SamplingPercentage": - err = unpopulate(val, "SamplingPercentage", &c.SamplingPercentage) - delete(rawMsg, key) - case "TenantId": - err = unpopulate(val, "TenantID", &c.TenantID) - delete(rawMsg, key) - case "WorkspaceResourceId": - err = unpopulate(val, "WorkspaceResourceID", &c.WorkspaceResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentPurgeBody. -func (c ComponentPurgeBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filters", c.Filters) - populate(objectMap, "table", c.Table) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ComponentsResource. -func (c ComponentsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - 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 fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "diagnosticcontext": - err = unpopulate(val, "Diagnosticcontext", &i.Diagnosticcontext) - delete(rawMsg, key) - case "time": - err = unpopulateTimeRFC3339(val, "Time", &i.Time) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MyWorkbook. -func (m MyWorkbook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "kind", m.Kind) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MyWorkbookProperties. -func (m MyWorkbookProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", m.Category) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "serializedData", m.SerializedData) - populate(objectMap, "sourceId", m.SourceID) - populate(objectMap, "storageUri", m.StorageURI) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "timeModified", m.TimeModified) - populate(objectMap, "userId", m.UserID) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MyWorkbookResource. -func (m MyWorkbookResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TagsResource. -func (t TagsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebTest. -func (w WebTest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", w.ID) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebTestProperties. -func (w WebTestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "Configuration", w.Configuration) - populate(objectMap, "Description", w.Description) - populate(objectMap, "Enabled", w.Enabled) - populate(objectMap, "Frequency", w.Frequency) - populate(objectMap, "Locations", w.Locations) - populate(objectMap, "provisioningState", w.ProvisioningState) - populate(objectMap, "RetryEnabled", w.RetryEnabled) - populate(objectMap, "SyntheticMonitorId", w.SyntheticMonitorID) - populate(objectMap, "Timeout", w.Timeout) - populate(objectMap, "Kind", w.WebTestKind) - populate(objectMap, "Name", w.WebTestName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WebtestsResource. -func (w WebtestsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkItemCreateConfiguration. -func (w WorkItemCreateConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ConnectorDataConfiguration", w.ConnectorDataConfiguration) - populate(objectMap, "ConnectorId", w.ConnectorID) - populate(objectMap, "ValidateOnly", w.ValidateOnly) - populate(objectMap, "WorkItemProperties", w.WorkItemProperties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Workbook. -func (w Workbook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "identity", w.Identity) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookProperties. -func (w WorkbookProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", w.Category) - populate(objectMap, "description", w.Description) - populate(objectMap, "displayName", w.DisplayName) - populate(objectMap, "revision", w.Revision) - populate(objectMap, "serializedData", w.SerializedData) - populate(objectMap, "sourceId", w.SourceID) - populate(objectMap, "storageUri", w.StorageURI) - populate(objectMap, "tags", w.Tags) - populateTimeRFC3339(objectMap, "timeModified", w.TimeModified) - populate(objectMap, "userId", w.UserID) - populate(objectMap, "version", w.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkbookProperties. -func (w *WorkbookProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "category": - err = unpopulate(val, "Category", &w.Category) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &w.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &w.DisplayName) - delete(rawMsg, key) - case "revision": - err = unpopulate(val, "Revision", &w.Revision) - delete(rawMsg, key) - case "serializedData": - err = unpopulate(val, "SerializedData", &w.SerializedData) - delete(rawMsg, key) - case "sourceId": - err = unpopulate(val, "SourceID", &w.SourceID) - delete(rawMsg, key) - case "storageUri": - err = unpopulate(val, "StorageURI", &w.StorageURI) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &w.Tags) - delete(rawMsg, key) - case "timeModified": - err = unpopulateTimeRFC3339(val, "TimeModified", &w.TimeModified) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &w.UserID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &w.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookPropertiesUpdateParameters. -func (w WorkbookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "category", w.Category) - populate(objectMap, "description", w.Description) - populate(objectMap, "displayName", w.DisplayName) - populate(objectMap, "revision", w.Revision) - populate(objectMap, "serializedData", w.SerializedData) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookResource. -func (w WorkbookResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "identity", w.Identity) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookResourceIdentity. -func (w WorkbookResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", w.PrincipalID) - populate(objectMap, "tenantId", w.TenantID) - populate(objectMap, "type", w.Type) - populate(objectMap, "userAssignedIdentities", w.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplate. -func (w WorkbookTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateLocalizedGallery. -func (w WorkbookTemplateLocalizedGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "galleries", w.Galleries) - populate(objectMap, "templateData", &w.TemplateData) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateProperties. -func (w WorkbookTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", w.Author) - populate(objectMap, "galleries", w.Galleries) - populate(objectMap, "localized", w.Localized) - populate(objectMap, "priority", w.Priority) - populate(objectMap, "templateData", &w.TemplateData) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateResource. -func (w WorkbookTemplateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", w.ID) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookTemplateUpdateParameters. -func (w WorkbookTemplateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WorkbookUpdateParameters. -func (w WorkbookUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}