diff --git a/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md b/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md index 9d0a0acc5815..5716d962d883 100644 --- a/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md +++ b/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md @@ -1,5 +1,33 @@ # Release History +## 1.2.0 (2023-09-25) +### Features Added + +- New enum type `Operation` with values `OperationActive`, `OperationAddBegin`, `OperationAddComplete`, `OperationDeleteBegin`, `OperationDeleteComplete` +- New enum type `Status` with values `StatusActive`, `StatusDeleting`, `StatusFailed`, `StatusInProgress` +- New function `*ClientFactory.NewCreationSupportedClient() *CreationSupportedClient` +- New function `*ClientFactory.NewMonitoredSubscriptionsClient() *MonitoredSubscriptionsClient` +- New function `NewCreationSupportedClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CreationSupportedClient, error)` +- New function `*CreationSupportedClient.Get(context.Context, string, *CreationSupportedClientGetOptions) (CreationSupportedClientGetResponse, error)` +- New function `*CreationSupportedClient.NewListPager(string, *CreationSupportedClientListOptions) *runtime.Pager[CreationSupportedClientListResponse]` +- New function `NewMonitoredSubscriptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MonitoredSubscriptionsClient, error)` +- New function `*MonitoredSubscriptionsClient.BeginCreateorUpdate(context.Context, string, string, string, *MonitoredSubscriptionsClientBeginCreateorUpdateOptions) (*runtime.Poller[MonitoredSubscriptionsClientCreateorUpdateResponse], error)` +- New function `*MonitoredSubscriptionsClient.BeginDelete(context.Context, string, string, string, *MonitoredSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[MonitoredSubscriptionsClientDeleteResponse], error)` +- New function `*MonitoredSubscriptionsClient.Get(context.Context, string, string, string, *MonitoredSubscriptionsClientGetOptions) (MonitoredSubscriptionsClientGetResponse, error)` +- New function `*MonitoredSubscriptionsClient.NewListPager(string, string, *MonitoredSubscriptionsClientListOptions) *runtime.Pager[MonitoredSubscriptionsClientListResponse]` +- New function `*MonitoredSubscriptionsClient.BeginUpdate(context.Context, string, string, string, *MonitoredSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[MonitoredSubscriptionsClientUpdateResponse], error)` +- New struct `CreateResourceSupportedProperties` +- New struct `CreateResourceSupportedResponse` +- New struct `CreateResourceSupportedResponseList` +- New struct `MonitoredSubscription` +- New struct `MonitoredSubscriptionProperties` +- New struct `MonitoredSubscriptionPropertiesList` +- New struct `SubscriptionList` +- New field `Cspm` in struct `MonitorUpdateProperties` +- New field `Automuting` in struct `MonitoringTagRulesProperties` +- New field `Cspm` in struct `OrganizationProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/datadog/armdatadog/autorest.md b/sdk/resourcemanager/datadog/armdatadog/autorest.md index 1d68ae2b2b5f..04dcc2bdd7de 100644 --- a/sdk/resourcemanager/datadog/armdatadog/autorest.md +++ b/sdk/resourcemanager/datadog/armdatadog/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datadog/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datadog/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 1.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/datadog/armdatadog/client_factory.go b/sdk/resourcemanager/datadog/armdatadog/client_factory.go index 7dac4d0f52e5..8b755ff03ed3 100644 --- a/sdk/resourcemanager/datadog/armdatadog/client_factory.go +++ b/sdk/resourcemanager/datadog/armdatadog/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -38,11 +37,21 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } +func (c *ClientFactory) NewCreationSupportedClient() *CreationSupportedClient { + subClient, _ := NewCreationSupportedClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewMarketplaceAgreementsClient() *MarketplaceAgreementsClient { subClient, _ := NewMarketplaceAgreementsClient(c.subscriptionID, c.credential, c.options) return subClient } +func (c *ClientFactory) NewMonitoredSubscriptionsClient() *MonitoredSubscriptionsClient { + subClient, _ := NewMonitoredSubscriptionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewMonitorsClient() *MonitorsClient { subClient, _ := NewMonitorsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -53,12 +62,12 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { return subClient } -func (c *ClientFactory) NewTagRulesClient() *TagRulesClient { - subClient, _ := NewTagRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSingleSignOnConfigurationsClient() *SingleSignOnConfigurationsClient { + subClient, _ := NewSingleSignOnConfigurationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSingleSignOnConfigurationsClient() *SingleSignOnConfigurationsClient { - subClient, _ := NewSingleSignOnConfigurationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTagRulesClient() *TagRulesClient { + subClient, _ := NewTagRulesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/datadog/armdatadog/constants.go b/sdk/resourcemanager/datadog/armdatadog/constants.go index 9d44585375d7..604bdaaf4cc0 100644 --- a/sdk/resourcemanager/datadog/armdatadog/constants.go +++ b/sdk/resourcemanager/datadog/armdatadog/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog const ( moduleName = "armdatadog" - moduleVersion = "v1.1.1" + moduleVersion = "v1.2.0" ) // CreatedByType - The type of identity that created the resource. @@ -49,7 +48,7 @@ func PossibleLiftrResourceCategoriesValues() []LiftrResourceCategories { } } -// ManagedIdentityTypes - Identity type +// ManagedIdentityTypes - Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. type ManagedIdentityTypes string const ( @@ -102,6 +101,28 @@ func PossibleMonitoringStatusValues() []MonitoringStatus { } } +// Operation - The operation for the patch on the resource. +type Operation string + +const ( + OperationActive Operation = "Active" + OperationAddBegin Operation = "AddBegin" + OperationAddComplete Operation = "AddComplete" + OperationDeleteBegin Operation = "DeleteBegin" + OperationDeleteComplete Operation = "DeleteComplete" +) + +// PossibleOperationValues returns the possible values for the Operation const type. +func PossibleOperationValues() []Operation { + return []Operation{ + OperationActive, + OperationAddBegin, + OperationAddComplete, + OperationDeleteBegin, + OperationDeleteComplete, + } +} + type ProvisioningState string const ( @@ -151,6 +172,26 @@ func PossibleSingleSignOnStatesValues() []SingleSignOnStates { } } +// Status - The state of monitoring. +type Status string + +const ( + StatusActive Status = "Active" + StatusDeleting Status = "Deleting" + StatusFailed Status = "Failed" + StatusInProgress Status = "InProgress" +) + +// PossibleStatusValues returns the possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{ + StatusActive, + StatusDeleting, + StatusFailed, + StatusInProgress, + } +} + // TagAction - Valid actions for a filtering tag. Exclusion takes priority over inclusion. type TagAction string diff --git a/sdk/resourcemanager/datadog/armdatadog/creationsupported_client.go b/sdk/resourcemanager/datadog/armdatadog/creationsupported_client.go new file mode 100644 index 000000000000..d0cc0ee9716c --- /dev/null +++ b/sdk/resourcemanager/datadog/armdatadog/creationsupported_client.go @@ -0,0 +1,152 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatadog + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CreationSupportedClient contains the methods for the CreationSupported group. +// Don't use this type directly, use NewCreationSupportedClient() instead. +type CreationSupportedClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCreationSupportedClient creates a new instance of CreationSupportedClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCreationSupportedClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CreationSupportedClient, error) { + cl, err := arm.NewClient(moduleName+".CreationSupportedClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CreationSupportedClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Informs if the current subscription is being already monitored for selected Datadog organization. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - datadogOrganizationID - Datadog Organization Id +// - options - CreationSupportedClientGetOptions contains the optional parameters for the CreationSupportedClient.Get method. +func (client *CreationSupportedClient) Get(ctx context.Context, datadogOrganizationID string, options *CreationSupportedClientGetOptions) (CreationSupportedClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, datadogOrganizationID, options) + if err != nil { + return CreationSupportedClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CreationSupportedClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CreationSupportedClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *CreationSupportedClient) getCreateRequest(ctx context.Context, datadogOrganizationID string, options *CreationSupportedClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + reqQP.Set("datadogOrganizationId", datadogOrganizationID) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CreationSupportedClient) getHandleResponse(resp *http.Response) (CreationSupportedClientGetResponse, error) { + result := CreationSupportedClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CreateResourceSupportedResponse); err != nil { + return CreationSupportedClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Informs if the current subscription is being already monitored for selected Datadog organization. +// +// Generated from API version 2023-01-01 +// - datadogOrganizationID - Datadog Organization Id +// - options - CreationSupportedClientListOptions contains the optional parameters for the CreationSupportedClient.NewListPager +// method. +func (client *CreationSupportedClient) NewListPager(datadogOrganizationID string, options *CreationSupportedClientListOptions) *runtime.Pager[CreationSupportedClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CreationSupportedClientListResponse]{ + More: func(page CreationSupportedClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *CreationSupportedClientListResponse) (CreationSupportedClientListResponse, error) { + req, err := client.listCreateRequest(ctx, datadogOrganizationID, options) + if err != nil { + return CreationSupportedClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CreationSupportedClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CreationSupportedClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CreationSupportedClient) listCreateRequest(ctx context.Context, datadogOrganizationID string, options *CreationSupportedClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/subscriptionStatuses" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + reqQP.Set("datadogOrganizationId", datadogOrganizationID) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CreationSupportedClient) listHandleResponse(resp *http.Response) (CreationSupportedClientListResponse, error) { + result := CreationSupportedClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CreateResourceSupportedResponseList); err != nil { + return CreationSupportedClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/datadog/armdatadog/go.mod b/sdk/resourcemanager/datadog/armdatadog/go.mod index 4f460e9b2517..83a9430c4e54 100644 --- a/sdk/resourcemanager/datadog/armdatadog/go.mod +++ b/sdk/resourcemanager/datadog/armdatadog/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/datadog/armdatadog/go.sum b/sdk/resourcemanager/datadog/armdatadog/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/datadog/armdatadog/go.sum +++ b/sdk/resourcemanager/datadog/armdatadog/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/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/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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/datadog/armdatadog/marketplaceagreements_client.go b/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client.go index ef2d299d1731..e2cfa64361c2 100644 --- a/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -47,22 +46,25 @@ func NewMarketplaceAgreementsClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Create Datadog marketplace agreement in the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - options - MarketplaceAgreementsClientCreateOrUpdateOptions contains the optional parameters for the MarketplaceAgreementsClient.CreateOrUpdate // method. func (client *MarketplaceAgreementsClient) CreateOrUpdate(ctx context.Context, options *MarketplaceAgreementsClientCreateOrUpdateOptions) (MarketplaceAgreementsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, options) if err != nil { return MarketplaceAgreementsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MarketplaceAgreementsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MarketplaceAgreementsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MarketplaceAgreementsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -77,11 +79,14 @@ func (client *MarketplaceAgreementsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -97,7 +102,7 @@ func (client *MarketplaceAgreementsClient) createOrUpdateHandleResponse(resp *ht // NewListPager - List Datadog marketplace agreements in the subscription. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - options - MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.NewListPager // method. func (client *MarketplaceAgreementsClient) NewListPager(options *MarketplaceAgreementsClientListOptions) *runtime.Pager[MarketplaceAgreementsClientListResponse] { @@ -140,7 +145,7 @@ func (client *MarketplaceAgreementsClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client_example_test.go b/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client_example_test.go deleted file mode 100644 index 681ea3e495f6..000000000000 --- a/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client_example_test.go +++ /dev/null @@ -1,111 +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. -// DO NOT EDIT. - -package armdatadog_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_List.json -func ExampleMarketplaceAgreementsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMarketplaceAgreementsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AgreementResourceListResponse = armdatadog.AgreementResourceListResponse{ - // Value: []*armdatadog.AgreementResource{ - // { - // Name: to.Ptr("planid1"), - // Type: to.Ptr("Microsoft.Datadog/agreements"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Datadog/agreements/id1"), - // Properties: &armdatadog.AgreementProperties{ - // Accepted: to.Ptr(false), - // LicenseTextLink: to.Ptr("test.licenseLink1"), - // Plan: to.Ptr("planid1"), - // PrivacyPolicyLink: to.Ptr("test.privacyPolicyLink1"), - // Product: to.Ptr("offid1"), - // Publisher: to.Ptr("pubid1"), - // RetrieveDatetime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T11:33:07.12132Z"); return t}()), - // Signature: to.Ptr("ASDFSDAFWEFASDGWERLWER"), - // }, - // }, - // { - // Name: to.Ptr("planid2"), - // Type: to.Ptr("Microsoft.Datadog/agreements"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Datadog/agreements/id2"), - // Properties: &armdatadog.AgreementProperties{ - // Accepted: to.Ptr(false), - // LicenseTextLink: to.Ptr("test.licenseLin2k"), - // Plan: to.Ptr("planid2"), - // PrivacyPolicyLink: to.Ptr("test.privacyPolicyLink2"), - // Product: to.Ptr("offid2"), - // Publisher: to.Ptr("pubid2"), - // RetrieveDatetime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-14T11:33:07.12132Z"); return t}()), - // Signature: to.Ptr("ASDFSDAFWEFASDGWERLWER"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MarketplaceAgreements_Create.json -func ExampleMarketplaceAgreementsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMarketplaceAgreementsClient().CreateOrUpdate(ctx, &armdatadog.MarketplaceAgreementsClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AgreementResource = armdatadog.AgreementResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Datadog/agreements"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Datadog/agreements/default"), - // Properties: &armdatadog.AgreementProperties{ - // Accepted: to.Ptr(true), - // LicenseTextLink: to.Ptr("test.licenseLink1"), - // Plan: to.Ptr("planid1"), - // PrivacyPolicyLink: to.Ptr("test.privacyPolicyLink1"), - // Product: to.Ptr("offid1"), - // Publisher: to.Ptr("pubid1"), - // RetrieveDatetime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T11:33:07.12132Z"); return t}()), - // Signature: to.Ptr("ASDFSDAFWEFASDGWERLWER"), - // }, - // } -} diff --git a/sdk/resourcemanager/datadog/armdatadog/models.go b/sdk/resourcemanager/datadog/armdatadog/models.go index 1bd5c6538ff4..87ee8a0f077d 100644 --- a/sdk/resourcemanager/datadog/armdatadog/models.go +++ b/sdk/resourcemanager/datadog/armdatadog/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -87,6 +86,26 @@ type AgreementResourceListResponse struct { Value []*AgreementResource } +// CreateResourceSupportedProperties - Datadog resource can be created or not properties. +type CreateResourceSupportedProperties struct { + // READ-ONLY; Indicates if selected subscription supports Datadog resource creation, if not it is already being monitored + // for the selected organization via multi subscription feature. + CreationSupported *bool + + // READ-ONLY; The ARM id of the subscription. + Name *string +} + +// CreateResourceSupportedResponse - Datadog resource can be created or not. +type CreateResourceSupportedResponse struct { + // Represents the properties of the resource. + Properties *CreateResourceSupportedProperties +} + +type CreateResourceSupportedResponseList struct { + Value []*CreateResourceSupportedResponse +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -135,7 +154,7 @@ type FilteringTag struct { } type Host struct { - // The aliases for the host. + // The aliases for the host installed via the Datadog agent. Aliases []*string // The Datadog integrations reporting metrics for the host. @@ -163,7 +182,7 @@ type HostMetadata struct { } type IdentityProperties struct { - // Identity type + // Specifies the identity type of the Datadog Monitor. At this time the only allowed value is 'SystemAssigned'. Type *ManagedIdentityTypes // READ-ONLY; The identity ID. @@ -222,18 +241,6 @@ type LogsAgent struct { Transport *string } -// MarketplaceAgreementsClientCreateOrUpdateOptions contains the optional parameters for the MarketplaceAgreementsClient.CreateOrUpdate -// method. -type MarketplaceAgreementsClientCreateOrUpdateOptions struct { - Body *AgreementResource -} - -// MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.NewListPager -// method. -type MarketplaceAgreementsClientListOptions struct { - // placeholder for future optional parameters -} - // MetricRules - Set of rules for sending metrics for the Monitor resource. type MetricRules struct { // List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action @@ -244,13 +251,14 @@ type MetricRules struct { // MonitorProperties - Properties specific to the monitor resource. type MonitorProperties struct { - // Datadog organization properties + // Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, and Applicationkey + // is required as well. DatadogOrganizationProperties *OrganizationProperties // Flag specifying if the resource monitoring is enabled or disabled. MonitoringStatus *MonitoringStatus - // User info + // Includes name, email and optionally, phone number. User Information can't be null. UserInfo *UserInfo // READ-ONLY @@ -313,6 +321,10 @@ type MonitorResourceUpdateParameters struct { // MonitorUpdateProperties - The set of properties that can be update in a PATCH request to a monitor resource. type MonitorUpdateProperties struct { + // The new cloud security posture management value of the monitor resource. This collects configuration information for all + // resources in a subscription and track conformance to industry benchmarks. + Cspm *bool + // Flag specifying if the resource monitoring is enabled or disabled. MonitoringStatus *MonitoringStatus } @@ -344,6 +356,40 @@ type MonitoredResourceListResponse struct { Value []*MonitoredResource } +// MonitoredSubscription - The list of subscriptions and it's monitoring status by current Datadog monitor. +type MonitoredSubscription struct { + // The reason of not monitoring the subscription. + Error *string + + // The state of monitoring. + Status *Status + + // The subscriptionId to be monitored. + SubscriptionID *string + + // Definition of the properties for a TagRules resource. + TagRules *MonitoringTagRulesProperties +} + +// MonitoredSubscriptionProperties - The request to update subscriptions needed to be monitored by the Datadog monitor resource. +type MonitoredSubscriptionProperties struct { + // The request to update subscriptions needed to be monitored by the Datadog monitor resource. + Properties *SubscriptionList + + // READ-ONLY; The id of the monitored subscription resource. + ID *string + + // READ-ONLY; Name of the monitored subscription resource. + Name *string + + // READ-ONLY; The type of the monitored subscription resource. + Type *string +} + +type MonitoredSubscriptionPropertiesList struct { + Value []*MonitoredSubscriptionProperties +} + // MonitoringTagRules - Capture logs and metrics of Azure resources based on ARM tags. type MonitoringTagRules struct { // Definition of the properties for a TagRules resource. @@ -373,6 +419,9 @@ type MonitoringTagRulesListResponse struct { // MonitoringTagRulesProperties - Definition of the properties for a TagRules resource. type MonitoringTagRulesProperties struct { + // Configuration to enable/disable auto-muting flag + Automuting *bool + // Set of rules for sending logs for the Monitor resource. LogRules *LogRules @@ -383,80 +432,6 @@ type MonitoringTagRulesProperties struct { ProvisioningState *ProvisioningState } -// MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. -type MonitorsClientBeginCreateOptions struct { - Body *MonitorResource - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. -type MonitorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MonitorsClientBeginUpdateOptions contains the optional parameters for the MonitorsClient.BeginUpdate method. -type MonitorsClientBeginUpdateOptions struct { - Body *MonitorResourceUpdateParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MonitorsClientGetDefaultKeyOptions contains the optional parameters for the MonitorsClient.GetDefaultKey method. -type MonitorsClientGetDefaultKeyOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. -type MonitorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListAPIKeysOptions contains the optional parameters for the MonitorsClient.NewListAPIKeysPager method. -type MonitorsClientListAPIKeysOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager -// method. -type MonitorsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.NewListHostsPager method. -type MonitorsClientListHostsOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListLinkedResourcesOptions contains the optional parameters for the MonitorsClient.NewListLinkedResourcesPager -// method. -type MonitorsClientListLinkedResourcesOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager -// method. -type MonitorsClientListMonitoredResourcesOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. -type MonitorsClientListOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientRefreshSetPasswordLinkOptions contains the optional parameters for the MonitorsClient.RefreshSetPasswordLink -// method. -type MonitorsClientRefreshSetPasswordLinkOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientSetDefaultKeyOptions contains the optional parameters for the MonitorsClient.SetDefaultKey method. -type MonitorsClientSetDefaultKeyOptions struct { - Body *APIKey -} - // OperationDisplay - The object that represents the operation. type OperationDisplay struct { // Description of the operation, e.g., 'Write monitors'. @@ -493,12 +468,8 @@ type OperationResult struct { Name *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// OrganizationProperties - Datadog organization properties +// OrganizationProperties - Specify the Datadog organization name. In the case of linking to existing organizations, Id, ApiKey, +// and Applicationkey is required as well. type OrganizationProperties struct { // Api key associated to the Datadog organization. APIKey *string @@ -506,27 +477,32 @@ type OrganizationProperties struct { // Application key associated to the Datadog organization. ApplicationKey *string + // The configuration which describes the state of cloud security posture management. This collects configuration information + // for all resources in a subscription and track conformance to industry + // benchmarks. + Cspm *bool + // The Id of the Enterprise App used for Single sign on. EnterpriseAppID *string - // The auth code used to linking to an existing datadog organization. + // Id of the Datadog organization. + ID *string + + // The auth code used to linking to an existing Datadog organization. LinkingAuthCode *string // The client_id from an existing in exchange for an auth token to link organization. LinkingClientID *string - // The redirect uri for linking. - RedirectURI *string - - // READ-ONLY; Id of the Datadog organization. - ID *string - - // READ-ONLY; Name of the Datadog organization. + // Name of the Datadog organization. Name *string + + // The redirect URI for linking. + RedirectURI *string } type ResourceSKU struct { - // REQUIRED; Name of the SKU. + // REQUIRED; Name of the SKU in {PlanId} format. For Terraform, the only allowed value is 'linking'. Name *string } @@ -534,26 +510,6 @@ type SetPasswordLink struct { SetPasswordLink *string } -// SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SingleSignOnConfigurationsClient.BeginCreateOrUpdate -// method. -type SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions struct { - Body *SingleSignOnResource - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SingleSignOnConfigurationsClientGetOptions contains the optional parameters for the SingleSignOnConfigurationsClient.Get -// method. -type SingleSignOnConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SingleSignOnConfigurationsClientListOptions contains the optional parameters for the SingleSignOnConfigurationsClient.NewListPager -// method. -type SingleSignOnConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - type SingleSignOnProperties struct { // The Id of the Enterprise App used for Single sign-on. EnterpriseAppID *string @@ -593,6 +549,15 @@ type SingleSignOnResourceListResponse struct { Value []*SingleSignOnResource } +// SubscriptionList - The request to update subscriptions needed to be monitored by the Datadog monitor resource. +type SubscriptionList struct { + // List of subscriptions and the state of the monitoring. + MonitoredSubscriptionList []*MonitoredSubscription + + // The operation for the patch on the resource. + Operation *Operation +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -614,22 +579,7 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TagRulesClientCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.CreateOrUpdate method. -type TagRulesClientCreateOrUpdateOptions struct { - Body *MonitoringTagRules -} - -// TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. -type TagRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// TagRulesClientListOptions contains the optional parameters for the TagRulesClient.NewListPager method. -type TagRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// UserInfo - User info +// UserInfo - Includes name, email and optionally, phone number. User Information can't be null. type UserInfo struct { // Email of the user used by Datadog for contacting them if needed EmailAddress *string diff --git a/sdk/resourcemanager/datadog/armdatadog/models_serde.go b/sdk/resourcemanager/datadog/armdatadog/models_serde.go index e888308270d7..2d420d1b0572 100644 --- a/sdk/resourcemanager/datadog/armdatadog/models_serde.go +++ b/sdk/resourcemanager/datadog/armdatadog/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -215,6 +214,91 @@ func (a *AgreementResourceListResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CreateResourceSupportedProperties. +func (c CreateResourceSupportedProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "creationSupported", c.CreationSupported) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateResourceSupportedProperties. +func (c *CreateResourceSupportedProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationSupported": + err = unpopulate(val, "CreationSupported", &c.CreationSupported) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CreateResourceSupportedResponse. +func (c CreateResourceSupportedResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateResourceSupportedResponse. +func (c *CreateResourceSupportedResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CreateResourceSupportedResponseList. +func (c CreateResourceSupportedResponseList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateResourceSupportedResponseList. +func (c *CreateResourceSupportedResponseList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -856,6 +940,7 @@ func (m *MonitorResourceUpdateParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorUpdateProperties. func (m MonitorUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "cspm", m.Cspm) populate(objectMap, "monitoringStatus", m.MonitoringStatus) return json.Marshal(objectMap) } @@ -869,6 +954,9 @@ func (m *MonitorUpdateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "cspm": + err = unpopulate(val, "Cspm", &m.Cspm) + delete(rawMsg, key) case "monitoringStatus": err = unpopulate(val, "MonitoringStatus", &m.MonitoringStatus) delete(rawMsg, key) @@ -954,6 +1042,111 @@ func (m *MonitoredResourceListResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MonitoredSubscription. +func (m MonitoredSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", m.Error) + populate(objectMap, "status", m.Status) + populate(objectMap, "subscriptionId", m.SubscriptionID) + populate(objectMap, "tagRules", m.TagRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoredSubscription. +func (m *MonitoredSubscription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &m.SubscriptionID) + delete(rawMsg, key) + case "tagRules": + err = unpopulate(val, "TagRules", &m.TagRules) + 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 MonitoredSubscriptionProperties. +func (m MonitoredSubscriptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoredSubscriptionProperties. +func (m *MonitoredSubscriptionProperties) 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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + 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 MonitoredSubscriptionPropertiesList. +func (m MonitoredSubscriptionPropertiesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonitoredSubscriptionPropertiesList. +func (m *MonitoredSubscriptionPropertiesList) 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 "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 MonitoringTagRules. func (m MonitoringTagRules) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1031,6 +1224,7 @@ func (m *MonitoringTagRulesListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringTagRulesProperties. func (m MonitoringTagRulesProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "automuting", m.Automuting) populate(objectMap, "logRules", m.LogRules) populate(objectMap, "metricRules", m.MetricRules) populate(objectMap, "provisioningState", m.ProvisioningState) @@ -1046,6 +1240,9 @@ func (m *MonitoringTagRulesProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "automuting": + err = unpopulate(val, "Automuting", &m.Automuting) + delete(rawMsg, key) case "logRules": err = unpopulate(val, "LogRules", &m.LogRules) delete(rawMsg, key) @@ -1173,6 +1370,7 @@ func (o OrganizationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "apiKey", o.APIKey) populate(objectMap, "applicationKey", o.ApplicationKey) + populate(objectMap, "cspm", o.Cspm) populate(objectMap, "enterpriseAppId", o.EnterpriseAppID) populate(objectMap, "id", o.ID) populate(objectMap, "linkingAuthCode", o.LinkingAuthCode) @@ -1197,6 +1395,9 @@ func (o *OrganizationProperties) UnmarshalJSON(data []byte) error { case "applicationKey": err = unpopulate(val, "ApplicationKey", &o.ApplicationKey) delete(rawMsg, key) + case "cspm": + err = unpopulate(val, "Cspm", &o.Cspm) + delete(rawMsg, key) case "enterpriseAppId": err = unpopulate(val, "EnterpriseAppID", &o.EnterpriseAppID) delete(rawMsg, key) @@ -1390,6 +1591,37 @@ func (s *SingleSignOnResourceListResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SubscriptionList. +func (s SubscriptionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "monitoredSubscriptionList", s.MonitoredSubscriptionList) + populate(objectMap, "operation", s.Operation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionList. +func (s *SubscriptionList) 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 "monitoredSubscriptionList": + err = unpopulate(val, "MonitoredSubscriptionList", &s.MonitoredSubscriptionList) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &s.Operation) + 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]any) diff --git a/sdk/resourcemanager/datadog/armdatadog/monitoredsubscriptions_client.go b/sdk/resourcemanager/datadog/armdatadog/monitoredsubscriptions_client.go new file mode 100644 index 000000000000..c8663e621d5c --- /dev/null +++ b/sdk/resourcemanager/datadog/armdatadog/monitoredsubscriptions_client.go @@ -0,0 +1,405 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatadog + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// MonitoredSubscriptionsClient contains the methods for the MonitoredSubscriptions group. +// Don't use this type directly, use NewMonitoredSubscriptionsClient() instead. +type MonitoredSubscriptionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewMonitoredSubscriptionsClient creates a new instance of MonitoredSubscriptionsClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewMonitoredSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitoredSubscriptionsClient, error) { + cl, err := arm.NewClient(moduleName+".MonitoredSubscriptionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MonitoredSubscriptionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateorUpdate - Add the subscriptions that should be monitored by the Datadog monitor resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Monitor resource name +// - configurationName - The configuration name. Only 'default' value is supported. +// - options - MonitoredSubscriptionsClientBeginCreateorUpdateOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginCreateorUpdate +// method. +func (client *MonitoredSubscriptionsClient) BeginCreateorUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginCreateorUpdateOptions) (*runtime.Poller[MonitoredSubscriptionsClientCreateorUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createorUpdate(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[MonitoredSubscriptionsClientCreateorUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[MonitoredSubscriptionsClientCreateorUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateorUpdate - Add the subscriptions that should be monitored by the Datadog monitor resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +func (client *MonitoredSubscriptionsClient) createorUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginCreateorUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createorUpdateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createorUpdateCreateRequest creates the CreateorUpdate request. +func (client *MonitoredSubscriptionsClient) createorUpdateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginCreateorUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} + +// BeginDelete - Updates the subscriptions that are being monitored by the Datadog monitor resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Monitor resource name +// - configurationName - Configuration name +// - options - MonitoredSubscriptionsClientBeginDeleteOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginDelete +// method. +func (client *MonitoredSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[MonitoredSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[MonitoredSubscriptionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[MonitoredSubscriptionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Updates the subscriptions that are being monitored by the Datadog monitor resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +func (client *MonitoredSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MonitoredSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - List the subscriptions currently being monitored by the Datadog monitor resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Monitor resource name +// - configurationName - The configuration name. Only 'default' value is supported. +// - options - MonitoredSubscriptionsClientGetOptions contains the optional parameters for the MonitoredSubscriptionsClient.Get +// method. +func (client *MonitoredSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientGetOptions) (MonitoredSubscriptionsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return MonitoredSubscriptionsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MonitoredSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitoredSubscriptionsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MonitoredSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MonitoredSubscriptionsClient) getHandleResponse(resp *http.Response) (MonitoredSubscriptionsClientGetResponse, error) { + result := MonitoredSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MonitoredSubscriptionProperties); err != nil { + return MonitoredSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List the subscriptions currently being monitored by the Datadog monitor resource. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Monitor resource name +// - options - MonitoredSubscriptionsClientListOptions contains the optional parameters for the MonitoredSubscriptionsClient.NewListPager +// method. +func (client *MonitoredSubscriptionsClient) NewListPager(resourceGroupName string, monitorName string, options *MonitoredSubscriptionsClientListOptions) *runtime.Pager[MonitoredSubscriptionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[MonitoredSubscriptionsClientListResponse]{ + More: func(page MonitoredSubscriptionsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *MonitoredSubscriptionsClientListResponse) (MonitoredSubscriptionsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, monitorName, options) + if err != nil { + return MonitoredSubscriptionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MonitoredSubscriptionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MonitoredSubscriptionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *MonitoredSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *MonitoredSubscriptionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *MonitoredSubscriptionsClient) listHandleResponse(resp *http.Response) (MonitoredSubscriptionsClientListResponse, error) { + result := MonitoredSubscriptionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MonitoredSubscriptionPropertiesList); err != nil { + return MonitoredSubscriptionsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates the subscriptions that are being monitored by the Datadog monitor resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Monitor resource name +// - configurationName - The configuration name. Only 'default' value is supported. +// - options - MonitoredSubscriptionsClientBeginUpdateOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginUpdate +// method. +func (client *MonitoredSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[MonitoredSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[MonitoredSubscriptionsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[MonitoredSubscriptionsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Updates the subscriptions that are being monitored by the Datadog monitor resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01 +func (client *MonitoredSubscriptionsClient) update(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateCreateRequest creates the Update request. +func (client *MonitoredSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *MonitoredSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/monitoredSubscriptions/{configurationName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if monitorName == "" { + return nil, errors.New("parameter monitorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{monitorName}", url.PathEscape(monitorName)) + if configurationName == "" { + return nil, errors.New("parameter configurationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationName}", url.PathEscape(configurationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil + } + return req, nil +} diff --git a/sdk/resourcemanager/datadog/armdatadog/monitors_client.go b/sdk/resourcemanager/datadog/armdatadog/monitors_client.go index 20734e942bb4..dbe02a141a1c 100644 --- a/sdk/resourcemanager/datadog/armdatadog/monitors_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/monitors_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -47,7 +46,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. @@ -57,9 +56,10 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitorsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -104,11 +106,14 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -116,7 +121,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-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. @@ -126,7 +131,8 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[MonitorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MonitorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -135,20 +141,22 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -171,7 +179,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,23 +188,26 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the properties of a specific monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-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. func (client *MonitorsClient) Get(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetOptions) (MonitorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return MonitorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -219,7 +230,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,23 +248,26 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl // GetDefaultKey - Get the default api key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientGetDefaultKeyOptions contains the optional parameters for the MonitorsClient.GetDefaultKey method. func (client *MonitorsClient) GetDefaultKey(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetDefaultKeyOptions) (MonitorsClientGetDefaultKeyResponse, error) { + var err error req, err := client.getDefaultKeyCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return MonitorsClientGetDefaultKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientGetDefaultKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientGetDefaultKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientGetDefaultKeyResponse{}, err } - return client.getDefaultKeyHandleResponse(resp) + resp, err := client.getDefaultKeyHandleResponse(httpResp) + return resp, err } // getDefaultKeyCreateRequest creates the GetDefaultKey request. @@ -276,7 +290,7 @@ func (client *MonitorsClient) getDefaultKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +307,7 @@ func (client *MonitorsClient) getDefaultKeyHandleResponse(resp *http.Response) ( // NewListPager - List all monitors under the specified subscription. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListResponse]{ @@ -335,7 +349,7 @@ func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *Mo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +366,7 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC // NewListAPIKeysPager - List the api keys for a given monitor resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientListAPIKeysOptions contains the optional parameters for the MonitorsClient.NewListAPIKeysPager @@ -405,7 +419,7 @@ func (client *MonitorsClient) listAPIKeysCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +436,7 @@ func (client *MonitorsClient) listAPIKeysHandleResponse(resp *http.Response) (Mo // NewListByResourceGroupPager - List all monitors under the specified resource group. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager // method. @@ -470,7 +484,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +501,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListHostsPager - List the hosts for a given monitor resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-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.NewListHostsPager method. @@ -539,7 +553,7 @@ func (client *MonitorsClient) listHostsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -556,7 +570,7 @@ func (client *MonitorsClient) listHostsHandleResponse(resp *http.Response) (Moni // NewListLinkedResourcesPager - List all Azure resources associated to the same Datadog organization as the target resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientListLinkedResourcesOptions contains the optional parameters for the MonitorsClient.NewListLinkedResourcesPager @@ -609,7 +623,7 @@ func (client *MonitorsClient) listLinkedResourcesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -626,7 +640,7 @@ func (client *MonitorsClient) listLinkedResourcesHandleResponse(resp *http.Respo // NewListMonitoredResourcesPager - List the resources currently being monitored by the Datadog monitor resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-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.NewListMonitoredResourcesPager @@ -679,7 +693,7 @@ func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -697,24 +711,27 @@ func (client *MonitorsClient) listMonitoredResourcesHandleResponse(resp *http.Re // RefreshSetPasswordLink - Refresh the set password link and return a latest one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientRefreshSetPasswordLinkOptions contains the optional parameters for the MonitorsClient.RefreshSetPasswordLink // method. func (client *MonitorsClient) RefreshSetPasswordLink(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientRefreshSetPasswordLinkOptions) (MonitorsClientRefreshSetPasswordLinkResponse, error) { + var err error req, err := client.refreshSetPasswordLinkCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return MonitorsClientRefreshSetPasswordLinkResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientRefreshSetPasswordLinkResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientRefreshSetPasswordLinkResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientRefreshSetPasswordLinkResponse{}, err } - return client.refreshSetPasswordLinkHandleResponse(resp) + resp, err := client.refreshSetPasswordLinkHandleResponse(httpResp) + return resp, err } // refreshSetPasswordLinkCreateRequest creates the RefreshSetPasswordLink request. @@ -737,7 +754,7 @@ func (client *MonitorsClient) refreshSetPasswordLinkCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -755,21 +772,23 @@ func (client *MonitorsClient) refreshSetPasswordLinkHandleResponse(resp *http.Re // SetDefaultKey - Set the default api key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientSetDefaultKeyOptions contains the optional parameters for the MonitorsClient.SetDefaultKey method. func (client *MonitorsClient) SetDefaultKey(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientSetDefaultKeyOptions) (MonitorsClientSetDefaultKeyResponse, error) { + var err error req, err := client.setDefaultKeyCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return MonitorsClientSetDefaultKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientSetDefaultKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientSetDefaultKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientSetDefaultKeyResponse{}, err } return MonitorsClientSetDefaultKeyResponse{}, nil } @@ -794,11 +813,14 @@ func (client *MonitorsClient) setDefaultKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -806,7 +828,7 @@ func (client *MonitorsClient) setDefaultKeyCreateRequest(ctx context.Context, re // BeginUpdate - Update a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - MonitorsClientBeginUpdateOptions contains the optional parameters for the MonitorsClient.BeginUpdate method. @@ -816,7 +838,8 @@ func (client *MonitorsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[MonitorsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MonitorsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitorsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -825,20 +848,22 @@ func (client *MonitorsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 func (client *MonitorsClient) update(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -861,11 +886,14 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } diff --git a/sdk/resourcemanager/datadog/armdatadog/monitors_client_example_test.go b/sdk/resourcemanager/datadog/armdatadog/monitors_client_example_test.go deleted file mode 100644 index 4eedb4b892f5..000000000000 --- a/sdk/resourcemanager/datadog/armdatadog/monitors_client_example_test.go +++ /dev/null @@ -1,504 +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. -// DO NOT EDIT. - -package armdatadog_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_List.json -func ExampleMonitorsClient_NewListAPIKeysPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListAPIKeysPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APIKeyListResponse = armdatadog.APIKeyListResponse{ - // Value: []*armdatadog.APIKey{ - // { - // Name: to.Ptr(""), - // Created: to.Ptr("2019-04-05 09:20:30"), - // CreatedBy: to.Ptr("john@example.com"), - // Key: to.Ptr("1111111111111111aaaaaaaaaaaaaaaa"), - // }, - // { - // Name: to.Ptr(""), - // Created: to.Ptr("2019-04-05 09:19:53"), - // CreatedBy: to.Ptr("jane@example.com"), - // Key: to.Ptr("2111111111111111aaaaaaaaaaaaaaaa"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_GetDefaultKey.json -func ExampleMonitorsClient_GetDefaultKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetDefaultKey(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APIKey = armdatadog.APIKey{ - // Name: to.Ptr(""), - // Created: to.Ptr("2019-04-05 09:20:30"), - // CreatedBy: to.Ptr("john@example.com"), - // Key: to.Ptr("1111111111111111aaaaaaaaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/ApiKeys_SetDefaultKey.json -func ExampleMonitorsClient_SetDefaultKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMonitorsClient().SetDefaultKey(ctx, "myResourceGroup", "myMonitor", &armdatadog.MonitorsClientSetDefaultKeyOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Hosts_List.json -func ExampleMonitorsClient_NewListHostsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListHostsPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.HostListResponse = armdatadog.HostListResponse{ - // Value: []*armdatadog.Host{ - // { - // Name: to.Ptr("vm1"), - // Aliases: []*string{ - // to.Ptr("vm1"), - // to.Ptr("65f2dd83-95ae-4f56-b6aa-a5dafc05f4cd")}, - // Apps: []*string{ - // to.Ptr("ntp"), - // to.Ptr("agent")}, - // Meta: &armdatadog.HostMetadata{ - // AgentVersion: to.Ptr("7.19.2"), - // InstallMethod: &armdatadog.InstallMethod{ - // InstallerVersion: to.Ptr("install_script-1.0.0"), - // Tool: to.Ptr("install_script"), - // ToolVersion: to.Ptr("install_script"), - // }, - // LogsAgent: &armdatadog.LogsAgent{ - // Transport: to.Ptr(""), - // }, - // }, - // }, - // { - // Name: to.Ptr("vm2"), - // Aliases: []*string{ - // to.Ptr("vm2"), - // to.Ptr("df631d9a-8178-4580-bf60-c697a5e8df4d")}, - // Apps: []*string{ - // to.Ptr("infra"), - // to.Ptr("agent")}, - // Meta: &armdatadog.HostMetadata{ - // AgentVersion: to.Ptr("7.18.1"), - // InstallMethod: &armdatadog.InstallMethod{ - // InstallerVersion: to.Ptr("install_script-1.0.0"), - // Tool: to.Ptr("install_script"), - // ToolVersion: to.Ptr("install_script"), - // }, - // LogsAgent: &armdatadog.LogsAgent{ - // Transport: to.Ptr("HTTP"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/LinkedResources_List.json -func ExampleMonitorsClient_NewListLinkedResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListLinkedResourcesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.LinkedResourceListResponse = armdatadog.LinkedResourceListResponse{ - // Value: []*armdatadog.LinkedResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/MonitoredResources_List.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListMonitoredResourcesPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitoredResourceListResponse = armdatadog.MonitoredResourceListResponse{ - // Value: []*armdatadog.MonitoredResource{ - // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVault"), - // ReasonForLogsStatus: to.Ptr("CapturedByRules"), - // ReasonForMetricsStatus: to.Ptr("CapturedByRules"), - // SendingLogs: to.Ptr(true), - // SendingMetrics: to.Ptr(true), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_List.json -func ExampleMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResponse = armdatadog.MonitorResourceListResponse{ - // Value: []*armdatadog.MonitorResource{ - // { - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Microsoft.Datadog/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US"), - // Properties: &armdatadog.MonitorProperties{ - // DatadogOrganizationProperties: &armdatadog.OrganizationProperties{ - // Name: to.Ptr("myOrg"), - // ID: to.Ptr("myOrg123"), - // }, - // LiftrResourceCategory: to.Ptr(armdatadog.LiftrResourceCategoriesMonitorLogs), - // LiftrResourcePreference: to.Ptr[int32](1), - // MonitoringStatus: to.Ptr(armdatadog.MonitoringStatusEnabled), - // ProvisioningState: to.Ptr(armdatadog.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_ListByResourceGroup.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorResourceListResponse = armdatadog.MonitorResourceListResponse{ - // Value: []*armdatadog.MonitorResource{ - // { - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Microsoft.Datadog/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US"), - // Properties: &armdatadog.MonitorProperties{ - // DatadogOrganizationProperties: &armdatadog.OrganizationProperties{ - // Name: to.Ptr("myOrg"), - // ID: to.Ptr("myOrg123"), - // }, - // LiftrResourceCategory: to.Ptr(armdatadog.LiftrResourceCategoriesMonitorLogs), - // LiftrResourcePreference: to.Ptr[int32](1), - // MonitoringStatus: to.Ptr(armdatadog.MonitoringStatusEnabled), - // ProvisioningState: to.Ptr(armdatadog.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Get.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Get(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdatadog.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Microsoft.Datadog/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US"), - // Properties: &armdatadog.MonitorProperties{ - // DatadogOrganizationProperties: &armdatadog.OrganizationProperties{ - // Name: to.Ptr("myOrg"), - // ID: to.Ptr("myOrg123"), - // }, - // LiftrResourceCategory: to.Ptr(armdatadog.LiftrResourceCategoriesMonitorLogs), - // LiftrResourcePreference: to.Ptr[int32](1), - // MonitoringStatus: to.Ptr(armdatadog.MonitoringStatusEnabled), - // ProvisioningState: to.Ptr(armdatadog.ProvisioningStateSucceeded), - // }, - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Create.json -func ExampleMonitorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginCreate(ctx, "myResourceGroup", "myMonitor", &armdatadog.MonitorsClientBeginCreateOptions{Body: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdatadog.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Microsoft.Datadog/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US"), - // Properties: &armdatadog.MonitorProperties{ - // DatadogOrganizationProperties: &armdatadog.OrganizationProperties{ - // Name: to.Ptr("myOrg"), - // ID: to.Ptr("myOrg123"), - // }, - // LiftrResourceCategory: to.Ptr(armdatadog.LiftrResourceCategoriesMonitorLogs), - // LiftrResourcePreference: to.Ptr[int32](1), - // MonitoringStatus: to.Ptr(armdatadog.MonitoringStatusEnabled), - // ProvisioningState: to.Ptr(armdatadog.ProvisioningStateSucceeded), - // }, - // SKU: &armdatadog.ResourceSKU{ - // Name: to.Ptr("free_Monthly"), - // }, - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Update.json -func ExampleMonitorsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginUpdate(ctx, "myResourceGroup", "myMonitor", &armdatadog.MonitorsClientBeginUpdateOptions{Body: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitorResource = armdatadog.MonitorResource{ - // Name: to.Ptr("myMonitor"), - // Type: to.Ptr("Microsoft.Datadog/monitors"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"), - // Location: to.Ptr("West US"), - // Properties: &armdatadog.MonitorProperties{ - // DatadogOrganizationProperties: &armdatadog.OrganizationProperties{ - // Name: to.Ptr("myOrg"), - // ID: to.Ptr("myOrg123"), - // }, - // LiftrResourceCategory: to.Ptr(armdatadog.LiftrResourceCategoriesMonitorLogs), - // LiftrResourcePreference: to.Ptr[int32](1), - // MonitoringStatus: to.Ptr(armdatadog.MonitoringStatusEnabled), - // ProvisioningState: to.Ptr(armdatadog.ProvisioningStateSucceeded), - // }, - // SKU: &armdatadog.ResourceSKU{ - // Name: to.Ptr("free_Monthly"), - // }, - // Tags: map[string]*string{ - // "Environment": to.Ptr("Dev"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Monitors_Delete.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().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/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/RefreshSetPassword_Get.json -func ExampleMonitorsClient_RefreshSetPasswordLink() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().RefreshSetPasswordLink(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SetPasswordLink = armdatadog.SetPasswordLink{ - // SetPasswordLink: to.Ptr("https://datadoghq.com/reset_password/tokenvalue123"), - // } -} diff --git a/sdk/resourcemanager/datadog/armdatadog/operations_client.go b/sdk/resourcemanager/datadog/armdatadog/operations_client.go index 93ca8950b6d9..129e2dbafa71 100644 --- a/sdk/resourcemanager/datadog/armdatadog/operations_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -38,9 +37,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// NewListPager - List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. +// NewListPager - List all operations provided by Microsoft.Datadog for the 2023-01-01 api version. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datadog/armdatadog/operations_client_example_test.go b/sdk/resourcemanager/datadog/armdatadog/operations_client_example_test.go deleted file mode 100644 index 4aba1e6920e0..000000000000 --- a/sdk/resourcemanager/datadog/armdatadog/operations_client_example_test.go +++ /dev/null @@ -1,55 +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. -// DO NOT EDIT. - -package armdatadog_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armdatadog.OperationListResult{ - // Value: []*armdatadog.OperationResult{ - // { - // Name: to.Ptr("Microsoft.Datadog/monitors/write"), - // Display: &armdatadog.OperationDisplay{ - // Description: to.Ptr("Write monitors resource"), - // Operation: to.Ptr("write"), - // Provider: to.Ptr("Microsoft.Datadog"), - // Resource: to.Ptr("monitors"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/datadog/armdatadog/options.go b/sdk/resourcemanager/datadog/armdatadog/options.go new file mode 100644 index 000000000000..46d6545fb95d --- /dev/null +++ b/sdk/resourcemanager/datadog/armdatadog/options.go @@ -0,0 +1,184 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatadog + +// CreationSupportedClientGetOptions contains the optional parameters for the CreationSupportedClient.Get method. +type CreationSupportedClientGetOptions struct { + // placeholder for future optional parameters +} + +// CreationSupportedClientListOptions contains the optional parameters for the CreationSupportedClient.NewListPager method. +type CreationSupportedClientListOptions struct { + // placeholder for future optional parameters +} + +// MarketplaceAgreementsClientCreateOrUpdateOptions contains the optional parameters for the MarketplaceAgreementsClient.CreateOrUpdate +// method. +type MarketplaceAgreementsClientCreateOrUpdateOptions struct { + Body *AgreementResource +} + +// MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.NewListPager +// method. +type MarketplaceAgreementsClientListOptions struct { + // placeholder for future optional parameters +} + +// MonitoredSubscriptionsClientBeginCreateorUpdateOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginCreateorUpdate +// method. +type MonitoredSubscriptionsClientBeginCreateorUpdateOptions struct { + Body *MonitoredSubscriptionProperties + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitoredSubscriptionsClientBeginDeleteOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginDelete +// method. +type MonitoredSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitoredSubscriptionsClientBeginUpdateOptions contains the optional parameters for the MonitoredSubscriptionsClient.BeginUpdate +// method. +type MonitoredSubscriptionsClientBeginUpdateOptions struct { + Body *MonitoredSubscriptionProperties + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitoredSubscriptionsClientGetOptions contains the optional parameters for the MonitoredSubscriptionsClient.Get method. +type MonitoredSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MonitoredSubscriptionsClientListOptions contains the optional parameters for the MonitoredSubscriptionsClient.NewListPager +// method. +type MonitoredSubscriptionsClientListOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. +type MonitorsClientBeginCreateOptions struct { + Body *MonitorResource + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. +type MonitorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitorsClientBeginUpdateOptions contains the optional parameters for the MonitorsClient.BeginUpdate method. +type MonitorsClientBeginUpdateOptions struct { + Body *MonitorResourceUpdateParameters + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitorsClientGetDefaultKeyOptions contains the optional parameters for the MonitorsClient.GetDefaultKey method. +type MonitorsClientGetDefaultKeyOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. +type MonitorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListAPIKeysOptions contains the optional parameters for the MonitorsClient.NewListAPIKeysPager method. +type MonitorsClientListAPIKeysOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. +type MonitorsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.NewListHostsPager method. +type MonitorsClientListHostsOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListLinkedResourcesOptions contains the optional parameters for the MonitorsClient.NewListLinkedResourcesPager +// method. +type MonitorsClientListLinkedResourcesOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager +// method. +type MonitorsClientListMonitoredResourcesOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. +type MonitorsClientListOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientRefreshSetPasswordLinkOptions contains the optional parameters for the MonitorsClient.RefreshSetPasswordLink +// method. +type MonitorsClientRefreshSetPasswordLinkOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientSetDefaultKeyOptions contains the optional parameters for the MonitorsClient.SetDefaultKey method. +type MonitorsClientSetDefaultKeyOptions struct { + Body *APIKey +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the SingleSignOnConfigurationsClient.BeginCreateOrUpdate +// method. +type SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions struct { + Body *SingleSignOnResource + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SingleSignOnConfigurationsClientGetOptions contains the optional parameters for the SingleSignOnConfigurationsClient.Get +// method. +type SingleSignOnConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SingleSignOnConfigurationsClientListOptions contains the optional parameters for the SingleSignOnConfigurationsClient.NewListPager +// method. +type SingleSignOnConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// TagRulesClientCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.CreateOrUpdate method. +type TagRulesClientCreateOrUpdateOptions struct { + Body *MonitoringTagRules +} + +// TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. +type TagRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// TagRulesClientListOptions contains the optional parameters for the TagRulesClient.NewListPager method. +type TagRulesClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/datadog/armdatadog/response_types.go b/sdk/resourcemanager/datadog/armdatadog/response_types.go index 1ca49b3deaad..a73b8f4752a8 100644 --- a/sdk/resourcemanager/datadog/armdatadog/response_types.go +++ b/sdk/resourcemanager/datadog/armdatadog/response_types.go @@ -3,12 +3,22 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog +// CreationSupportedClientGetResponse contains the response from method CreationSupportedClient.Get. +type CreationSupportedClientGetResponse struct { + // Datadog resource can be created or not. + CreateResourceSupportedResponse +} + +// CreationSupportedClientListResponse contains the response from method CreationSupportedClient.NewListPager. +type CreationSupportedClientListResponse struct { + CreateResourceSupportedResponseList +} + // MarketplaceAgreementsClientCreateOrUpdateResponse contains the response from method MarketplaceAgreementsClient.CreateOrUpdate. type MarketplaceAgreementsClientCreateOrUpdateResponse struct { AgreementResource @@ -16,9 +26,38 @@ type MarketplaceAgreementsClientCreateOrUpdateResponse struct { // MarketplaceAgreementsClientListResponse contains the response from method MarketplaceAgreementsClient.NewListPager. type MarketplaceAgreementsClientListResponse struct { + // Response of a list operation. AgreementResourceListResponse } +// MonitoredSubscriptionsClientCreateorUpdateResponse contains the response from method MonitoredSubscriptionsClient.BeginCreateorUpdate. +type MonitoredSubscriptionsClientCreateorUpdateResponse struct { + // The request to update subscriptions needed to be monitored by the Datadog monitor resource. + MonitoredSubscriptionProperties +} + +// MonitoredSubscriptionsClientDeleteResponse contains the response from method MonitoredSubscriptionsClient.BeginDelete. +type MonitoredSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// MonitoredSubscriptionsClientGetResponse contains the response from method MonitoredSubscriptionsClient.Get. +type MonitoredSubscriptionsClientGetResponse struct { + // The request to update subscriptions needed to be monitored by the Datadog monitor resource. + MonitoredSubscriptionProperties +} + +// MonitoredSubscriptionsClientListResponse contains the response from method MonitoredSubscriptionsClient.NewListPager. +type MonitoredSubscriptionsClientListResponse struct { + MonitoredSubscriptionPropertiesList +} + +// MonitoredSubscriptionsClientUpdateResponse contains the response from method MonitoredSubscriptionsClient.BeginUpdate. +type MonitoredSubscriptionsClientUpdateResponse struct { + // The request to update subscriptions needed to be monitored by the Datadog monitor resource. + MonitoredSubscriptionProperties +} + // MonitorsClientCreateResponse contains the response from method MonitorsClient.BeginCreate. type MonitorsClientCreateResponse struct { MonitorResource @@ -41,31 +80,37 @@ type MonitorsClientGetResponse struct { // MonitorsClientListAPIKeysResponse contains the response from method MonitorsClient.NewListAPIKeysPager. type MonitorsClientListAPIKeysResponse struct { + // Response of a list operation. APIKeyListResponse } // MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.NewListByResourceGroupPager. type MonitorsClientListByResourceGroupResponse struct { + // Response of a list operation. MonitorResourceListResponse } // MonitorsClientListHostsResponse contains the response from method MonitorsClient.NewListHostsPager. type MonitorsClientListHostsResponse struct { + // Response of a list operation. HostListResponse } // MonitorsClientListLinkedResourcesResponse contains the response from method MonitorsClient.NewListLinkedResourcesPager. type MonitorsClientListLinkedResourcesResponse struct { + // Response of a list operation. LinkedResourceListResponse } // MonitorsClientListMonitoredResourcesResponse contains the response from method MonitorsClient.NewListMonitoredResourcesPager. type MonitorsClientListMonitoredResourcesResponse struct { + // Response of a list operation. MonitoredResourceListResponse } // MonitorsClientListResponse contains the response from method MonitorsClient.NewListPager. type MonitorsClientListResponse struct { + // Response of a list operation. MonitorResourceListResponse } @@ -86,6 +131,7 @@ type MonitorsClientUpdateResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of GET request to list the Microsoft.Datadog operations. OperationListResult } @@ -101,20 +147,24 @@ type SingleSignOnConfigurationsClientGetResponse struct { // SingleSignOnConfigurationsClientListResponse contains the response from method SingleSignOnConfigurationsClient.NewListPager. type SingleSignOnConfigurationsClientListResponse struct { + // Response of a list operation. SingleSignOnResourceListResponse } // TagRulesClientCreateOrUpdateResponse contains the response from method TagRulesClient.CreateOrUpdate. type TagRulesClientCreateOrUpdateResponse struct { + // Capture logs and metrics of Azure resources based on ARM tags. MonitoringTagRules } // TagRulesClientGetResponse contains the response from method TagRulesClient.Get. type TagRulesClientGetResponse struct { + // Capture logs and metrics of Azure resources based on ARM tags. MonitoringTagRules } // TagRulesClientListResponse contains the response from method TagRulesClient.NewListPager. type TagRulesClientListResponse struct { + // Response of a list operation. MonitoringTagRulesListResponse } diff --git a/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go b/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go index 6eb9a2e5a54b..8c97ef6d9621 100644 --- a/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -47,7 +46,7 @@ func NewSingleSignOnConfigurationsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Configures single-sign-on for this resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Configuration name @@ -59,9 +58,10 @@ func (client *SingleSignOnConfigurationsClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SingleSignOnConfigurationsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SingleSignOnConfigurationsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SingleSignOnConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *SingleSignOnConfigurationsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Configures single-sign-on for this resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 func (client *SingleSignOnConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,11 +112,14 @@ func (client *SingleSignOnConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -122,25 +127,28 @@ func (client *SingleSignOnConfigurationsClient) createOrUpdateCreateRequest(ctx // Get - Gets the datadog single sign-on resource for the given Monitor. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Configuration name // - options - SingleSignOnConfigurationsClientGetOptions contains the optional parameters for the SingleSignOnConfigurationsClient.Get // method. func (client *SingleSignOnConfigurationsClient) Get(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *SingleSignOnConfigurationsClientGetOptions) (SingleSignOnConfigurationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) if err != nil { return SingleSignOnConfigurationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SingleSignOnConfigurationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SingleSignOnConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SingleSignOnConfigurationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -167,7 +175,7 @@ func (client *SingleSignOnConfigurationsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +192,7 @@ func (client *SingleSignOnConfigurationsClient) getHandleResponse(resp *http.Res // NewListPager - List the single sign-on configurations for a given monitor resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - options - SingleSignOnConfigurationsClientListOptions contains the optional parameters for the SingleSignOnConfigurationsClient.NewListPager @@ -237,7 +245,7 @@ func (client *SingleSignOnConfigurationsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client_example_test.go b/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client_example_test.go deleted file mode 100644 index 286e2794cd2e..000000000000 --- a/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client_example_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatadog_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_List.json -func ExampleSingleSignOnConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSingleSignOnConfigurationsClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SingleSignOnResourceListResponse = armdatadog.SingleSignOnResourceListResponse{ - // Value: []*armdatadog.SingleSignOnResource{ - // { - // Name: to.Ptr("default"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdatadog.SingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdatadog.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.datadoghq.com/IAmSomeHash"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_CreateOrUpdate.json -func ExampleSingleSignOnConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSingleSignOnConfigurationsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armdatadog.SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions{Body: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdatadog.SingleSignOnResource{ - // Name: to.Ptr("default"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdatadog.SingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdatadog.SingleSignOnStatesEnable), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/SingleSignOnConfigurations_Get.json -func ExampleSingleSignOnConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSingleSignOnConfigurationsClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SingleSignOnResource = armdatadog.SingleSignOnResource{ - // Name: to.Ptr("default"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/singleSignOnConfigurations/default"), - // Properties: &armdatadog.SingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // SingleSignOnState: to.Ptr(armdatadog.SingleSignOnStatesEnable), - // SingleSignOnURL: to.Ptr("https://www.datadoghq.com/IAmSomeHash"), - // }, - // } -} diff --git a/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go b/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go index 8d947955c4bf..3ac92401f144 100644 --- a/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog @@ -47,24 +46,27 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Create or update a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Rule set name // - options - TagRulesClientCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.CreateOrUpdate method. func (client *TagRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientCreateOrUpdateOptions) (TagRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { return TagRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -91,11 +93,14 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -112,24 +117,27 @@ func (client *TagRulesClient) createOrUpdateHandleResponse(resp *http.Response) // Get - Get a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Rule set name // - options - TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. func (client *TagRulesClient) Get(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientGetOptions) (TagRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { return TagRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -156,7 +164,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +181,7 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl // NewListPager - List the tag rules for a given monitor resource. // -// Generated from API version 2021-03-01 +// Generated from API version 2023-01-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.NewListPager method. @@ -225,7 +233,7 @@ func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/datadog/armdatadog/tagrules_client_example_test.go b/sdk/resourcemanager/datadog/armdatadog/tagrules_client_example_test.go deleted file mode 100644 index c232f3a9bdf7..000000000000 --- a/sdk/resourcemanager/datadog/armdatadog/tagrules_client_example_test.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatadog_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/datadog/armdatadog" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_List.json -func ExampleTagRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTagRulesClient().NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitoringTagRulesListResponse = armdatadog.MonitoringTagRulesListResponse{ - // Value: []*armdatadog.MonitoringTagRules{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"), - // Properties: &armdatadog.MonitoringTagRulesProperties{ - // LogRules: &armdatadog.LogRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(false), - // SendResourceLogs: to.Ptr(true), - // SendSubscriptionLogs: to.Ptr(true), - // }, - // MetricRules: &armdatadog.MetricRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_CreateOrUpdate.json -func ExampleTagRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armdatadog.TagRulesClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitoringTagRules = armdatadog.MonitoringTagRules{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"), - // Properties: &armdatadog.MonitoringTagRulesProperties{ - // LogRules: &armdatadog.LogRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(false), - // SendResourceLogs: to.Ptr(true), - // SendSubscriptionLogs: to.Ptr(true), - // }, - // MetricRules: &armdatadog.MetricRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/datadog/resource-manager/Microsoft.Datadog/stable/2021-03-01/examples/TagRules_Get.json -func ExampleTagRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatadog.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitoringTagRules = armdatadog.MonitoringTagRules{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"), - // Properties: &armdatadog.MonitoringTagRulesProperties{ - // LogRules: &armdatadog.LogRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionInclude), - // Value: to.Ptr("Prod"), - // }, - // { - // Name: to.Ptr("Environment"), - // Action: to.Ptr(armdatadog.TagActionExclude), - // Value: to.Ptr("Dev"), - // }}, - // SendAADLogs: to.Ptr(false), - // SendResourceLogs: to.Ptr(true), - // SendSubscriptionLogs: to.Ptr(true), - // }, - // MetricRules: &armdatadog.MetricRules{ - // FilteringTags: []*armdatadog.FilteringTag{ - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/datadog/armdatadog/time_rfc3339.go b/sdk/resourcemanager/datadog/armdatadog/time_rfc3339.go index 532d3eeeaf2c..d5edd2a53960 100644 --- a/sdk/resourcemanager/datadog/armdatadog/time_rfc3339.go +++ b/sdk/resourcemanager/datadog/armdatadog/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatadog