diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md b/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md index 8cd28011e82b..7734d78f83af 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md +++ b/sdk/resourcemanager/dynatrace/armdynatrace/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0 (2022-09-16) +### Other Changes + + ## 0.1.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 0.1.0, which contains breaking changes. diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md b/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md index 72b49bc83143..3a4d1b0a46f6 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md +++ b/sdk/resourcemanager/dynatrace/armdynatrace/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/dynatrace/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/dynatrace/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dynatrace/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/dynatrace/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_constants.go b/sdk/resourcemanager/dynatrace/armdynatrace/constants.go similarity index 99% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_constants.go rename to sdk/resourcemanager/dynatrace/armdynatrace/constants.go index 2c68940444ed..54685c6142ef 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_constants.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/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 armdynatrace const ( moduleName = "armdynatrace" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/go.mod b/sdk/resourcemanager/dynatrace/armdynatrace/go.mod index 58030a3f57d2..3a408d6dc1c2 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/go.mod +++ b/sdk/resourcemanager/dynatrace/armdynatrace/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatr 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/dynatrace/armdynatrace/go.sum b/sdk/resourcemanager/dynatrace/armdynatrace/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/go.sum +++ b/sdk/resourcemanager/dynatrace/armdynatrace/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/dynatrace/armdynatrace/zz_generated_models.go b/sdk/resourcemanager/dynatrace/armdynatrace/models.go similarity index 98% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_models.go rename to sdk/resourcemanager/dynatrace/armdynatrace/models.go index 3e6249fbb411..81f2566cd0eb 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_models.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/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 armdynatrace @@ -63,10 +64,10 @@ type AppServiceInfo struct { // AppServiceListResponse - Response of a list App Services Operation. type AppServiceListResponse struct { - // REQUIRED; The link to the next page of items + // The link to the next page of items NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page + // The items on this page Value []*AppServiceInfo `json:"value,omitempty"` } @@ -277,11 +278,11 @@ type MonitorResource struct { // MonitorResourceListResult - The response of a MonitorResource list operation. type MonitorResourceListResult struct { - // REQUIRED; The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page Value []*MonitorResource `json:"value,omitempty"` + + // The link to the next page of items + NextLink *string `json:"nextLink,omitempty"` } // MonitorResourceUpdate - The updatable properties of the MonitorResource. @@ -325,10 +326,10 @@ type MonitoredResource struct { // MonitoredResourceListResponse - List of all the resources being monitored by Dynatrace monitor resource type MonitoredResourceListResponse struct { - // REQUIRED; The link to the next page of items + // The link to the next page of items NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page + // The items on this page Value []*MonitoredResource `json:"value,omitempty"` } @@ -589,11 +590,11 @@ type SingleSignOnResource struct { // SingleSignOnResourceListResult - The response of a DynatraceSingleSignOnResource list operation. type SingleSignOnResourceListResult struct { - // REQUIRED; The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page Value []*SingleSignOnResource `json:"value,omitempty"` + + // The link to the next page of items + NextLink *string `json:"nextLink,omitempty"` } // SystemData - Metadata pertaining to creation and last modification of the resource. @@ -637,11 +638,11 @@ type TagRule struct { // TagRuleListResult - The response of a TagRule list operation. type TagRuleListResult struct { - // REQUIRED; The link to the next page of items - NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page Value []*TagRule `json:"value,omitempty"` + + // The link to the next page of items + NextLink *string `json:"nextLink,omitempty"` } // TagRuleUpdate - The updatable properties of the TagRule. @@ -737,10 +738,10 @@ type VMExtensionPayload struct { // VMHostsListResponse - Response of a list VM Host Operation. type VMHostsListResponse struct { - // REQUIRED; The link to the next page of items + // The link to the next page of items NextLink *string `json:"nextLink,omitempty"` - // REQUIRED; The items on this page + // The items on this page Value []*VMInfo `json:"value,omitempty"` } diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go b/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go new file mode 100644 index 000000000000..3872d2759de1 --- /dev/null +++ b/sdk/resourcemanager/dynatrace/armdynatrace/models_serde.go @@ -0,0 +1,1709 @@ +//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 armdynatrace + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AccountInfo. +func (a AccountInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountId", a.AccountID) + populate(objectMap, "regionId", a.RegionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInfo. +func (a *AccountInfo) 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 "accountId": + err = unpopulate(val, "AccountID", &a.AccountID) + delete(rawMsg, key) + case "regionId": + err = unpopulate(val, "RegionID", &a.RegionID) + 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 AccountInfoSecure. +func (a AccountInfoSecure) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiKey", a.APIKey) + populate(objectMap, "accountId", a.AccountID) + populate(objectMap, "regionId", a.RegionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountInfoSecure. +func (a *AccountInfoSecure) 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 "apiKey": + err = unpopulate(val, "APIKey", &a.APIKey) + delete(rawMsg, key) + case "accountId": + err = unpopulate(val, "AccountID", &a.AccountID) + delete(rawMsg, key) + case "regionId": + err = unpopulate(val, "RegionID", &a.RegionID) + 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 AppServiceInfo. +func (a AppServiceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoUpdateSetting", a.AutoUpdateSetting) + populate(objectMap, "availabilityState", a.AvailabilityState) + populate(objectMap, "hostGroup", a.HostGroup) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "logModule", a.LogModule) + populate(objectMap, "monitoringType", a.MonitoringType) + populate(objectMap, "resourceId", a.ResourceID) + populate(objectMap, "updateStatus", a.UpdateStatus) + populate(objectMap, "version", a.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServiceInfo. +func (a *AppServiceInfo) 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 "autoUpdateSetting": + err = unpopulate(val, "AutoUpdateSetting", &a.AutoUpdateSetting) + delete(rawMsg, key) + case "availabilityState": + err = unpopulate(val, "AvailabilityState", &a.AvailabilityState) + delete(rawMsg, key) + case "hostGroup": + err = unpopulate(val, "HostGroup", &a.HostGroup) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &a.HostName) + delete(rawMsg, key) + case "logModule": + err = unpopulate(val, "LogModule", &a.LogModule) + delete(rawMsg, key) + case "monitoringType": + err = unpopulate(val, "MonitoringType", &a.MonitoringType) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + delete(rawMsg, key) + case "updateStatus": + err = unpopulate(val, "UpdateStatus", &a.UpdateStatus) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &a.Version) + 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 AppServiceListResponse. +func (a AppServiceListResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServiceListResponse. +func (a *AppServiceListResponse) 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 "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, 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 EnvironmentInfo. +func (e EnvironmentInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "environmentId", e.EnvironmentID) + populate(objectMap, "ingestionKey", e.IngestionKey) + populate(objectMap, "landingURL", e.LandingURL) + populate(objectMap, "logsIngestionEndpoint", e.LogsIngestionEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentInfo. +func (e *EnvironmentInfo) 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 "environmentId": + err = unpopulate(val, "EnvironmentID", &e.EnvironmentID) + delete(rawMsg, key) + case "ingestionKey": + err = unpopulate(val, "IngestionKey", &e.IngestionKey) + delete(rawMsg, key) + case "landingURL": + err = unpopulate(val, "LandingURL", &e.LandingURL) + delete(rawMsg, key) + case "logsIngestionEndpoint": + err = unpopulate(val, "LogsIngestionEndpoint", &e.LogsIngestionEndpoint) + 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 EnvironmentProperties. +func (e EnvironmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountInfo", e.AccountInfo) + populate(objectMap, "environmentInfo", e.EnvironmentInfo) + populate(objectMap, "singleSignOnProperties", e.SingleSignOnProperties) + populate(objectMap, "userId", e.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentProperties. +func (e *EnvironmentProperties) 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 "accountInfo": + err = unpopulate(val, "AccountInfo", &e.AccountInfo) + delete(rawMsg, key) + case "environmentInfo": + err = unpopulate(val, "EnvironmentInfo", &e.EnvironmentInfo) + delete(rawMsg, key) + case "singleSignOnProperties": + err = unpopulate(val, "SingleSignOnProperties", &e.SingleSignOnProperties) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &e.UserID) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) 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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, 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) + 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, "error", e.Error) + 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 "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 FilteringTag. +func (f FilteringTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", f.Action) + populate(objectMap, "name", f.Name) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FilteringTag. +func (f *FilteringTag) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &f.Action) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityProperties. +func (i IdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties. +func (i *IdentityProperties) 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 "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + 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 LinkableEnvironmentListResponse. +func (l LinkableEnvironmentListResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkableEnvironmentListResponse. +func (l *LinkableEnvironmentListResponse) 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 "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + 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 LinkableEnvironmentRequest. +func (l LinkableEnvironmentRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "region", l.Region) + populate(objectMap, "tenantId", l.TenantID) + populate(objectMap, "userPrincipal", l.UserPrincipal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkableEnvironmentRequest. +func (l *LinkableEnvironmentRequest) 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 "region": + err = unpopulate(val, "Region", &l.Region) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &l.TenantID) + delete(rawMsg, key) + case "userPrincipal": + err = unpopulate(val, "UserPrincipal", &l.UserPrincipal) + 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 LinkableEnvironmentResponse. +func (l LinkableEnvironmentResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "environmentId", l.EnvironmentID) + populate(objectMap, "environmentName", l.EnvironmentName) + populate(objectMap, "planData", l.PlanData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkableEnvironmentResponse. +func (l *LinkableEnvironmentResponse) 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 "environmentId": + err = unpopulate(val, "EnvironmentID", &l.EnvironmentID) + delete(rawMsg, key) + case "environmentName": + err = unpopulate(val, "EnvironmentName", &l.EnvironmentName) + delete(rawMsg, key) + case "planData": + err = unpopulate(val, "PlanData", &l.PlanData) + 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 LogRules. +func (l LogRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filteringTags", l.FilteringTags) + populate(objectMap, "sendAadLogs", l.SendAADLogs) + populate(objectMap, "sendActivityLogs", l.SendActivityLogs) + populate(objectMap, "sendSubscriptionLogs", l.SendSubscriptionLogs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogRules. +func (l *LogRules) 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 "filteringTags": + err = unpopulate(val, "FilteringTags", &l.FilteringTags) + delete(rawMsg, key) + case "sendAadLogs": + err = unpopulate(val, "SendAADLogs", &l.SendAADLogs) + delete(rawMsg, key) + case "sendActivityLogs": + err = unpopulate(val, "SendActivityLogs", &l.SendActivityLogs) + delete(rawMsg, key) + case "sendSubscriptionLogs": + err = unpopulate(val, "SendSubscriptionLogs", &l.SendSubscriptionLogs) + 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 MetricRules. +func (m MetricRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filteringTags", m.FilteringTags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetricRules. +func (m *MetricRules) 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 "filteringTags": + err = unpopulate(val, "FilteringTags", &m.FilteringTags) + 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 MonitorProperties. +func (m MonitorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dynatraceEnvironmentProperties", m.DynatraceEnvironmentProperties) + populate(objectMap, "liftrResourceCategory", m.LiftrResourceCategory) + populate(objectMap, "liftrResourcePreference", m.LiftrResourcePreference) + populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) + populate(objectMap, "monitoringStatus", m.MonitoringStatus) + populate(objectMap, "planData", m.PlanData) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "userInfo", m.UserInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorProperties. +func (m *MonitorProperties) 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 "dynatraceEnvironmentProperties": + err = unpopulate(val, "DynatraceEnvironmentProperties", &m.DynatraceEnvironmentProperties) + delete(rawMsg, key) + case "liftrResourceCategory": + err = unpopulate(val, "LiftrResourceCategory", &m.LiftrResourceCategory) + delete(rawMsg, key) + case "liftrResourcePreference": + err = unpopulate(val, "LiftrResourcePreference", &m.LiftrResourcePreference) + delete(rawMsg, key) + case "marketplaceSubscriptionStatus": + err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) + delete(rawMsg, key) + case "monitoringStatus": + err = unpopulate(val, "MonitoringStatus", &m.MonitoringStatus) + delete(rawMsg, key) + case "planData": + err = unpopulate(val, "PlanData", &m.PlanData) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "userInfo": + err = unpopulate(val, "UserInfo", &m.UserInfo) + 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 MonitorResource. +func (m MonitorResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + 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 MonitorResource. +func (m *MonitorResource) 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 "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 "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 MonitorResourceListResult. +func (m MonitorResourceListResult) 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 MonitorResourceListResult. +func (m *MonitorResourceListResult) 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 MonitorResourceUpdate. +func (m MonitorResourceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dynatraceEnvironmentProperties", m.DynatraceEnvironmentProperties) + populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) + populate(objectMap, "monitoringStatus", m.MonitoringStatus) + populate(objectMap, "planData", m.PlanData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "userInfo", m.UserInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitorResourceUpdate. +func (m *MonitorResourceUpdate) 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 "dynatraceEnvironmentProperties": + err = unpopulate(val, "DynatraceEnvironmentProperties", &m.DynatraceEnvironmentProperties) + delete(rawMsg, key) + case "marketplaceSubscriptionStatus": + err = unpopulate(val, "MarketplaceSubscriptionStatus", &m.MarketplaceSubscriptionStatus) + delete(rawMsg, key) + case "monitoringStatus": + err = unpopulate(val, "MonitoringStatus", &m.MonitoringStatus) + delete(rawMsg, key) + case "planData": + err = unpopulate(val, "PlanData", &m.PlanData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "userInfo": + err = unpopulate(val, "UserInfo", &m.UserInfo) + 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 MonitoredResource. +func (m MonitoredResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "reasonForLogsStatus", m.ReasonForLogsStatus) + populate(objectMap, "reasonForMetricsStatus", m.ReasonForMetricsStatus) + populate(objectMap, "sendingLogs", m.SendingLogs) + populate(objectMap, "sendingMetrics", m.SendingMetrics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoredResource. +func (m *MonitoredResource) 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 "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "reasonForLogsStatus": + err = unpopulate(val, "ReasonForLogsStatus", &m.ReasonForLogsStatus) + delete(rawMsg, key) + case "reasonForMetricsStatus": + err = unpopulate(val, "ReasonForMetricsStatus", &m.ReasonForMetricsStatus) + delete(rawMsg, key) + case "sendingLogs": + err = unpopulate(val, "SendingLogs", &m.SendingLogs) + delete(rawMsg, key) + case "sendingMetrics": + err = unpopulate(val, "SendingMetrics", &m.SendingMetrics) + 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 MonitoredResourceListResponse. +func (m MonitoredResourceListResponse) 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 MonitoredResourceListResponse. +func (m *MonitoredResourceListResponse) 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 MonitoringTagRulesProperties. +func (m MonitoringTagRulesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logRules", m.LogRules) + populate(objectMap, "metricRules", m.MetricRules) + populate(objectMap, "provisioningState", m.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoringTagRulesProperties. +func (m *MonitoringTagRulesProperties) 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 "logRules": + err = unpopulate(val, "LogRules", &m.LogRules) + delete(rawMsg, key) + case "metricRules": + err = unpopulate(val, "MetricRules", &m.MetricRules) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + 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, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + 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 "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, 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) + } + 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, "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 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 "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 PlanData. +func (p PlanData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "billingCycle", p.BillingCycle) + populateTimeRFC3339(objectMap, "effectiveDate", p.EffectiveDate) + populate(objectMap, "planDetails", p.PlanDetails) + populate(objectMap, "usageType", p.UsageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PlanData. +func (p *PlanData) 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 "billingCycle": + err = unpopulate(val, "BillingCycle", &p.BillingCycle) + delete(rawMsg, key) + case "effectiveDate": + err = unpopulateTimeRFC3339(val, "EffectiveDate", &p.EffectiveDate) + delete(rawMsg, key) + case "planDetails": + err = unpopulate(val, "PlanDetails", &p.PlanDetails) + delete(rawMsg, key) + case "usageType": + err = unpopulate(val, "UsageType", &p.UsageType) + 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 SSODetailsRequest. +func (s SSODetailsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "userPrincipal", s.UserPrincipal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SSODetailsRequest. +func (s *SSODetailsRequest) 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 "userPrincipal": + err = unpopulate(val, "UserPrincipal", &s.UserPrincipal) + 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 SSODetailsResponse. +func (s SSODetailsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadDomains", s.AADDomains) + populate(objectMap, "adminUsers", s.AdminUsers) + populate(objectMap, "isSsoEnabled", s.IsSsoEnabled) + populate(objectMap, "metadataUrl", s.MetadataURL) + populate(objectMap, "singleSignOnUrl", s.SingleSignOnURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SSODetailsResponse. +func (s *SSODetailsResponse) 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 "aadDomains": + err = unpopulate(val, "AADDomains", &s.AADDomains) + delete(rawMsg, key) + case "adminUsers": + err = unpopulate(val, "AdminUsers", &s.AdminUsers) + delete(rawMsg, key) + case "isSsoEnabled": + err = unpopulate(val, "IsSsoEnabled", &s.IsSsoEnabled) + delete(rawMsg, key) + case "metadataUrl": + err = unpopulate(val, "MetadataURL", &s.MetadataURL) + delete(rawMsg, key) + case "singleSignOnUrl": + err = unpopulate(val, "SingleSignOnURL", &s.SingleSignOnURL) + 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 SingleSignOnProperties. +func (s SingleSignOnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadDomains", s.AADDomains) + populate(objectMap, "enterpriseAppId", s.EnterpriseAppID) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "singleSignOnState", s.SingleSignOnState) + populate(objectMap, "singleSignOnUrl", s.SingleSignOnURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleSignOnProperties. +func (s *SingleSignOnProperties) 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 "aadDomains": + err = unpopulate(val, "AADDomains", &s.AADDomains) + delete(rawMsg, key) + case "enterpriseAppId": + err = unpopulate(val, "EnterpriseAppID", &s.EnterpriseAppID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "singleSignOnState": + err = unpopulate(val, "SingleSignOnState", &s.SingleSignOnState) + delete(rawMsg, key) + case "singleSignOnUrl": + err = unpopulate(val, "SingleSignOnURL", &s.SingleSignOnURL) + 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 SingleSignOnResource. +func (s SingleSignOnResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleSignOnResource. +func (s *SingleSignOnResource) 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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 SingleSignOnResourceListResult. +func (s SingleSignOnResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SingleSignOnResourceListResult. +func (s *SingleSignOnResourceListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 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 TagRule. +func (t TagRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagRule. +func (t *TagRule) 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 "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + 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 TagRuleListResult. +func (t TagRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagRuleListResult. +func (t *TagRuleListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + 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 TagRuleUpdate. +func (t TagRuleUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logRules", t.LogRules) + populate(objectMap, "metricRules", t.MetricRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagRuleUpdate. +func (t *TagRuleUpdate) 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 "logRules": + err = unpopulate(val, "LogRules", &t.LogRules) + delete(rawMsg, key) + case "metricRules": + err = unpopulate(val, "MetricRules", &t.MetricRules) + 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 UserInfo. +func (u UserInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "country", u.Country) + populate(objectMap, "emailAddress", u.EmailAddress) + populate(objectMap, "firstName", u.FirstName) + populate(objectMap, "lastName", u.LastName) + populate(objectMap, "phoneNumber", u.PhoneNumber) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserInfo. +func (u *UserInfo) 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 "country": + err = unpopulate(val, "Country", &u.Country) + delete(rawMsg, key) + case "emailAddress": + err = unpopulate(val, "EmailAddress", &u.EmailAddress) + delete(rawMsg, key) + case "firstName": + err = unpopulate(val, "FirstName", &u.FirstName) + delete(rawMsg, key) + case "lastName": + err = unpopulate(val, "LastName", &u.LastName) + delete(rawMsg, key) + case "phoneNumber": + err = unpopulate(val, "PhoneNumber", &u.PhoneNumber) + 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 VMExtensionPayload. +func (v VMExtensionPayload) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "environmentId", v.EnvironmentID) + populate(objectMap, "ingestionKey", v.IngestionKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMExtensionPayload. +func (v *VMExtensionPayload) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentId": + err = unpopulate(val, "EnvironmentID", &v.EnvironmentID) + delete(rawMsg, key) + case "ingestionKey": + err = unpopulate(val, "IngestionKey", &v.IngestionKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMHostsListResponse. +func (v VMHostsListResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMHostsListResponse. +func (v *VMHostsListResponse) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VMInfo. +func (v VMInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "autoUpdateSetting", v.AutoUpdateSetting) + populate(objectMap, "availabilityState", v.AvailabilityState) + populate(objectMap, "hostGroup", v.HostGroup) + populate(objectMap, "hostName", v.HostName) + populate(objectMap, "logModule", v.LogModule) + populate(objectMap, "monitoringType", v.MonitoringType) + populate(objectMap, "resourceId", v.ResourceID) + populate(objectMap, "updateStatus", v.UpdateStatus) + populate(objectMap, "version", v.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VMInfo. +func (v *VMInfo) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoUpdateSetting": + err = unpopulate(val, "AutoUpdateSetting", &v.AutoUpdateSetting) + delete(rawMsg, key) + case "availabilityState": + err = unpopulate(val, "AvailabilityState", &v.AvailabilityState) + delete(rawMsg, key) + case "hostGroup": + err = unpopulate(val, "HostGroup", &v.HostGroup) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &v.HostName) + delete(rawMsg, key) + case "logModule": + err = unpopulate(val, "LogModule", &v.LogModule) + delete(rawMsg, key) + case "monitoringType": + err = unpopulate(val, "MonitoringType", &v.MonitoringType) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &v.ResourceID) + delete(rawMsg, key) + case "updateStatus": + err = unpopulate(val, "UpdateStatus", &v.UpdateStatus) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &v.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, 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/dynatrace/armdynatrace/zz_generated_monitors_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go similarity index 95% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_monitors_client.go rename to sdk/resourcemanager/dynatrace/armdynatrace/monitors_client.go index bc078225df19..493c6fd45e3b 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_monitors_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/monitors_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 armdynatrace @@ -56,7 +57,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // resource - Resource create parameters. @@ -78,7 +79,7 @@ func (client *MonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 func (client *MonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, resource MonitorResource, options *MonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, resource, options) if err != nil { @@ -114,7 +115,7 @@ func (client *MonitorsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -122,7 +123,7 @@ func (client *MonitorsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. @@ -142,7 +143,7 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -178,7 +179,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +187,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. @@ -225,7 +226,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +243,7 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl // GetAccountCredentials - Gets the user account credentials for a Monitor // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientGetAccountCredentialsOptions contains the optional parameters for the MonitorsClient.GetAccountCredentials @@ -282,7 +283,7 @@ func (client *MonitorsClient) getAccountCredentialsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +300,7 @@ func (client *MonitorsClient) getAccountCredentialsHandleResponse(resp *http.Res // GetSSODetails - Gets the SSO configuration details from the partner. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientGetSSODetailsOptions contains the optional parameters for the MonitorsClient.GetSSODetails method. @@ -338,7 +339,7 @@ func (client *MonitorsClient) getSSODetailsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Request != nil { @@ -359,7 +360,7 @@ func (client *MonitorsClient) getSSODetailsHandleResponse(resp *http.Response) ( // GetVMHostPayload - Returns the payload that needs to be passed in the request body for installing Dynatrace agent on a // VM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientGetVMHostPayloadOptions contains the optional parameters for the MonitorsClient.GetVMHostPayload @@ -399,7 +400,7 @@ func (client *MonitorsClient) getVMHostPayloadCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -415,8 +416,7 @@ func (client *MonitorsClient) getVMHostPayloadHandleResponse(resp *http.Response } // NewListAppServicesPager - Gets list of App Services with Dynatrace PaaS OneAgent enabled -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientListAppServicesOptions contains the optional parameters for the MonitorsClient.ListAppServices @@ -469,7 +469,7 @@ func (client *MonitorsClient) listAppServicesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,8 +485,7 @@ func (client *MonitorsClient) listAppServicesHandleResponse(resp *http.Response) } // NewListByResourceGroupPager - List MonitorResource resources by resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup // method. @@ -534,7 +533,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -550,8 +549,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo } // NewListBySubscriptionIDPager - List all MonitorResource by subscriptionId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // options - MonitorsClientListBySubscriptionIDOptions contains the optional parameters for the MonitorsClient.ListBySubscriptionID // method. func (client *MonitorsClient) NewListBySubscriptionIDPager(options *MonitorsClientListBySubscriptionIDOptions) *runtime.Pager[MonitorsClientListBySubscriptionIDResponse] { @@ -594,7 +592,7 @@ func (client *MonitorsClient) listBySubscriptionIDCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -610,8 +608,7 @@ func (client *MonitorsClient) listBySubscriptionIDHandleResponse(resp *http.Resp } // NewListHostsPager - List the compute resources currently being monitored by the Dynatrace resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.ListHosts method. @@ -663,7 +660,7 @@ func (client *MonitorsClient) listHostsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -679,8 +676,7 @@ func (client *MonitorsClient) listHostsHandleResponse(resp *http.Response) (Moni } // NewListLinkableEnvironmentsPager - Gets all the Dynatrace environments that a user can link a azure resource to -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // request - The details of the linkable environment request. @@ -734,7 +730,7 @@ func (client *MonitorsClient) listLinkableEnvironmentsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, request) @@ -750,8 +746,7 @@ func (client *MonitorsClient) listLinkableEnvironmentsHandleResponse(resp *http. } // NewListMonitoredResourcesPager - List the resources currently being monitored by the Dynatrace monitor resource. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.ListMonitoredResources @@ -804,7 +799,7 @@ func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -821,7 +816,7 @@ func (client *MonitorsClient) listMonitoredResourcesHandleResponse(resp *http.Re // Update - Update a MonitorResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // resource - The resource properties to be updated. @@ -861,7 +856,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_operations_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go similarity index 95% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_operations_client.go rename to sdk/resourcemanager/dynatrace/armdynatrace/operations_client.go index 3e8f48fdf75f..2ef6742e964c 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_operations_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/operations_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 armdynatrace @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List the operations for Dynatrace.Observability -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // 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]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_response_types.go b/sdk/resourcemanager/dynatrace/armdynatrace/response_types.go similarity index 99% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_response_types.go rename to sdk/resourcemanager/dynatrace/armdynatrace/response_types.go index 0af2c6b5c144..dd886be0ecfd 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_response_types.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/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 armdynatrace diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_singlesignon_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go similarity index 96% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_singlesignon_client.go rename to sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_client.go index df5dd3d51f3a..5b3f36765718 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_singlesignon_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/singlesignon_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 armdynatrace @@ -56,7 +57,7 @@ func NewSingleSignOnClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // configurationName - Single Sign On Configuration Name @@ -79,7 +80,7 @@ func (client *SingleSignOnClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 func (client *SingleSignOnClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, resource SingleSignOnResource, options *SingleSignOnClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, resource, options) if err != nil { @@ -119,7 +120,7 @@ func (client *SingleSignOnClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -127,7 +128,7 @@ func (client *SingleSignOnClient) createOrUpdateCreateRequest(ctx context.Contex // Get - Get a DynatraceSingleSignOnResource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // configurationName - Single Sign On Configuration Name @@ -171,7 +172,7 @@ func (client *SingleSignOnClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,8 +188,7 @@ func (client *SingleSignOnClient) getHandleResponse(resp *http.Response) (Single } // NewListPager - List all DynatraceSingleSignOnResource by monitorName -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - SingleSignOnClientListOptions contains the optional parameters for the SingleSignOnClient.List method. @@ -240,7 +240,7 @@ func (client *SingleSignOnClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_tagrules_client.go b/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go similarity index 96% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_tagrules_client.go rename to sdk/resourcemanager/dynatrace/armdynatrace/tagrules_client.go index 7db538744d48..7656dc5b6656 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_tagrules_client.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/tagrules_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 armdynatrace @@ -56,7 +57,7 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // ruleSetName - Monitor resource name @@ -79,7 +80,7 @@ func (client *TagRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 func (client *TagRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, resource TagRule, options *TagRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, resource, options) if err != nil { @@ -119,7 +120,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -127,7 +128,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // ruleSetName - Monitor resource name @@ -148,7 +149,7 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 func (client *TagRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -188,7 +189,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +197,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // ruleSetName - Monitor resource name @@ -240,7 +241,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,8 +257,7 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl } // NewListPager - List all TagRule by monitorName -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // options - TagRulesClientListOptions contains the optional parameters for the TagRulesClient.List method. @@ -309,7 +309,7 @@ func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *TagRulesClient) listHandleResponse(resp *http.Response) (TagRulesC // Update - Update a TagRule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-09-01-preview +// Generated from API version 2021-09-01 // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Monitor resource name // ruleSetName - Monitor resource name @@ -371,7 +371,7 @@ func (client *TagRulesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-01-preview") + reqQP.Set("api-version", "2021-09-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_time_rfc3339.go b/sdk/resourcemanager/dynatrace/armdynatrace/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/dynatrace/armdynatrace/time_rfc3339.go index 9513db08db4a..228a96d7c14f 100644 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/dynatrace/armdynatrace/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 armdynatrace diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_monitors_client_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_monitors_client_test.go deleted file mode 100644 index 83de5938fb28..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_monitors_client_test.go +++ /dev/null @@ -1,375 +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 armdynatrace_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/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetAccountCredentials_MaximumSet_Gen.json -func ExampleMonitorsClient_GetAccountCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAccountCredentials(ctx, - "myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMonitoredResourcesPager("myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetVMHostPayload_MaximumSet_Gen.json -func ExampleMonitorsClient_GetVMHostPayload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetVMHostPayload(ctx, - "myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Get_MaximumSet_Gen.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myMonitor", - armdynatrace.MonitorResource{ - Location: to.Ptr("West US 2"), - Tags: map[string]*string{ - "Environment": to.Ptr("Dev"), - }, - Identity: &armdynatrace.IdentityProperties{ - Type: to.Ptr(armdynatrace.ManagedIdentityTypeSystemAssigned), - }, - Properties: &armdynatrace.MonitorProperties{ - DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - AccountInfo: &armdynatrace.AccountInfo{}, - EnvironmentInfo: &armdynatrace.EnvironmentInfo{}, - SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{}, - }, - LiftrResourceCategory: to.Ptr(armdynatrace.LiftrResourceCategoriesUnknown), - MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - PlanData: &armdynatrace.PlanData{ - BillingCycle: to.Ptr("Monthly"), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t }()), - PlanDetails: to.Ptr("dynatraceapitestplan"), - UsageType: to.Ptr("Committed"), - }, - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - UserInfo: &armdynatrace.UserInfo{ - Country: to.Ptr("westus2"), - EmailAddress: to.Ptr("alice@microsoft.com"), - FirstName: to.Ptr("Alice"), - LastName: to.Ptr("Bobab"), - PhoneNumber: to.Ptr("123456"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Update_MaximumSet_Gen.json -func ExampleMonitorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "myResourceGroup", - "myMonitor", - armdynatrace.MonitorResourceUpdate{ - DynatraceEnvironmentProperties: &armdynatrace.EnvironmentProperties{ - AccountInfo: &armdynatrace.AccountInfo{}, - EnvironmentInfo: &armdynatrace.EnvironmentInfo{}, - SingleSignOnProperties: &armdynatrace.SingleSignOnProperties{}, - }, - MarketplaceSubscriptionStatus: to.Ptr(armdynatrace.MarketplaceSubscriptionStatusActive), - MonitoringStatus: to.Ptr(armdynatrace.MonitoringStatusEnabled), - PlanData: &armdynatrace.PlanData{ - BillingCycle: to.Ptr("Monthly"), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-30T15:14:33+02:00"); return t }()), - PlanDetails: to.Ptr("dynatraceapitestplan"), - UsageType: to.Ptr("Committed"), - }, - Tags: map[string]*string{ - "Environment": to.Ptr("Dev"), - }, - UserInfo: &armdynatrace.UserInfo{ - Country: to.Ptr("westus2"), - EmailAddress: to.Ptr("alice@microsoft.com"), - FirstName: to.Ptr("Alice"), - LastName: to.Ptr("Bobab"), - PhoneNumber: to.Ptr("123456"), - }, - }, - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_Delete_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myMonitor", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListHosts_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListHostsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListHostsPager("myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListAppServices_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListAppServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAppServicesPager("myResourceGroup", - "myMonitor", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_GetSSODetails_MaximumSet_Gen.json -func ExampleMonitorsClient_GetSSODetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSSODetails(ctx, - "myResourceGroup", - "myMonitor", - &armdynatrace.MonitorsClientGetSSODetailsOptions{Request: &armdynatrace.SSODetailsRequest{ - UserPrincipal: to.Ptr("alice@microsoft.com"), - }, - }) - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Monitors_ListLinkableEnvironments_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListLinkableEnvironmentsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLinkableEnvironmentsPager("myResourceGroup", - "myMonitor", - armdynatrace.LinkableEnvironmentRequest{ - Region: to.Ptr("East US"), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - UserPrincipal: to.Ptr("alice@microsoft.com"), - }, - 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/dynatrace/armdynatrace/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_operations_client_test.go deleted file mode 100644 index 4de2ac3b6189..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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 armdynatrace_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_singlesignon_client_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_singlesignon_client_test.go deleted file mode 100644 index 2d7c25034a39..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_singlesignon_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 armdynatrace_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/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_CreateOrUpdate_MaximumSet_Gen.json -func ExampleSingleSignOnClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewSingleSignOnClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myMonitor", - "default", - armdynatrace.SingleSignOnResource{ - Properties: &armdynatrace.SingleSignOnProperties{ - AADDomains: []*string{ - to.Ptr("mpliftrdt20210811outlook.onmicrosoft.com")}, - EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - SingleSignOnState: to.Ptr(armdynatrace.SingleSignOnStatesEnable), - SingleSignOnURL: to.Ptr("https://www.dynatrace.io"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_Get_MaximumSet_Gen.json -func ExampleSingleSignOnClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewSingleSignOnClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myMonitor", - "default", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/SingleSignOn_List_MaximumSet_Gen.json -func ExampleSingleSignOnClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewSingleSignOnClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myMonitor", - 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/dynatrace/armdynatrace/ze_generated_example_tagrules_client_test.go b/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_tagrules_client_test.go deleted file mode 100644 index bf8a86350668..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/ze_generated_example_tagrules_client_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armdynatrace_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/dynatrace/armdynatrace" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Get_MaximumSet_Gen.json -func ExampleTagRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myMonitor", - "default", - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myMonitor", - "default", - armdynatrace.TagRule{ - Properties: &armdynatrace.MonitoringTagRulesProperties{ - LogRules: &armdynatrace.LogRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }, - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionExclude), - Value: to.Ptr("Dev"), - }}, - SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armdynatrace.MetricRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }}, - }, - ProvisioningState: to.Ptr(armdynatrace.ProvisioningStateAccepted), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Update_MaximumSet_Gen.json -func ExampleTagRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "myResourceGroup", - "myMonitor", - "default", - armdynatrace.TagRuleUpdate{ - LogRules: &armdynatrace.LogRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }, - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionExclude), - Value: to.Ptr("Dev"), - }}, - SendAADLogs: to.Ptr(armdynatrace.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armdynatrace.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armdynatrace.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armdynatrace.MetricRules{ - FilteringTags: []*armdynatrace.FilteringTag{ - { - Name: to.Ptr("Environment"), - Action: to.Ptr(armdynatrace.TagActionInclude), - Value: to.Ptr("Prod"), - }}, - }, - }, - 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/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_Delete_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myMonitor", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/dynatrace/resource-manager/Dynatrace.Observability/preview/2021-09-01-preview/examples/TagRules_List_MaximumSet_Gen.json -func ExampleTagRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armdynatrace.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myMonitor", - 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/dynatrace/armdynatrace/zz_generated_models_serde.go b/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_models_serde.go deleted file mode 100644 index a2219bdc3690..000000000000 --- a/sdk/resourcemanager/dynatrace/armdynatrace/zz_generated_models_serde.go +++ /dev/null @@ -1,205 +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 armdynatrace - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type IdentityProperties. -func (i IdentityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogRules. -func (l LogRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filteringTags", l.FilteringTags) - populate(objectMap, "sendAadLogs", l.SendAADLogs) - populate(objectMap, "sendActivityLogs", l.SendActivityLogs) - populate(objectMap, "sendSubscriptionLogs", l.SendSubscriptionLogs) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MetricRules. -func (m MetricRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filteringTags", m.FilteringTags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MonitorResource. -func (m MonitorResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - 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 MonitorResourceUpdate. -func (m MonitorResourceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynatraceEnvironmentProperties", m.DynatraceEnvironmentProperties) - populate(objectMap, "marketplaceSubscriptionStatus", m.MarketplaceSubscriptionStatus) - populate(objectMap, "monitoringStatus", m.MonitoringStatus) - populate(objectMap, "planData", m.PlanData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "userInfo", m.UserInfo) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PlanData. -func (p PlanData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "billingCycle", p.BillingCycle) - populateTimeRFC3339(objectMap, "effectiveDate", p.EffectiveDate) - populate(objectMap, "planDetails", p.PlanDetails) - populate(objectMap, "usageType", p.UsageType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PlanData. -func (p *PlanData) 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 "billingCycle": - err = unpopulate(val, "BillingCycle", &p.BillingCycle) - delete(rawMsg, key) - case "effectiveDate": - err = unpopulateTimeRFC3339(val, "EffectiveDate", &p.EffectiveDate) - delete(rawMsg, key) - case "planDetails": - err = unpopulate(val, "PlanDetails", &p.PlanDetails) - delete(rawMsg, key) - case "usageType": - err = unpopulate(val, "UsageType", &p.UsageType) - 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 SingleSignOnProperties. -func (s SingleSignOnProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadDomains", s.AADDomains) - populate(objectMap, "enterpriseAppId", s.EnterpriseAppID) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "singleSignOnState", s.SingleSignOnState) - populate(objectMap, "singleSignOnUrl", s.SingleSignOnURL) - 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 TagRuleUpdate. -func (t TagRuleUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "logRules", t.LogRules) - populate(objectMap, "metricRules", t.MetricRules) - 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) -} - -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 -}