diff --git a/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md b/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md index 9d0a0acc5815..30f2e0c79c2a 100644 --- a/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md +++ b/sdk/resourcemanager/datadog/armdatadog/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.2 (2023-06-19) +### Other Changes + + ## 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..a4941d018c5f 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.1.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/datadog/armdatadog/constants.go b/sdk/resourcemanager/datadog/armdatadog/constants.go index 9d44585375d7..18d9d0e78499 100644 --- a/sdk/resourcemanager/datadog/armdatadog/constants.go +++ b/sdk/resourcemanager/datadog/armdatadog/constants.go @@ -11,7 +11,7 @@ package armdatadog const ( moduleName = "armdatadog" - moduleVersion = "v1.1.1" + moduleVersion = "v1.1.2" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/datadog/armdatadog/go.mod b/sdk/resourcemanager/datadog/armdatadog/go.mod index 4f460e9b2517..2f749332897a 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.4.0 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 + github.com/davecgh/go-spew v1.1.1 // 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 + 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..b6bd7eaad1ba 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/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= +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..98e4374dee84 100644 --- a/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/marketplaceagreements_client.go @@ -47,7 +47,7 @@ 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 2022-06-01 // - options - MarketplaceAgreementsClientCreateOrUpdateOptions contains the optional parameters for the MarketplaceAgreementsClient.CreateOrUpdate // method. func (client *MarketplaceAgreementsClient) CreateOrUpdate(ctx context.Context, options *MarketplaceAgreementsClientCreateOrUpdateOptions) (MarketplaceAgreementsClientCreateOrUpdateResponse, error) { @@ -77,7 +77,7 @@ 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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -97,7 +97,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 2022-06-01 // - options - MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.NewListPager // method. func (client *MarketplaceAgreementsClient) NewListPager(options *MarketplaceAgreementsClientListOptions) *runtime.Pager[MarketplaceAgreementsClientListResponse] { @@ -140,7 +140,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", "2022-06-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..e18e09c155f8 100644 --- a/sdk/resourcemanager/datadog/armdatadog/models.go +++ b/sdk/resourcemanager/datadog/armdatadog/models.go @@ -509,20 +509,20 @@ type OrganizationProperties struct { // The Id of the Enterprise App used for Single sign on. EnterpriseAppID *string + // 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 + // Name of the Datadog organization. + Name *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 *string } type ResourceSKU struct { diff --git a/sdk/resourcemanager/datadog/armdatadog/monitors_client.go b/sdk/resourcemanager/datadog/armdatadog/monitors_client.go index 20734e942bb4..dd276236ecdd 100644 --- a/sdk/resourcemanager/datadog/armdatadog/monitors_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/monitors_client.go @@ -47,7 +47,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 2022-06-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. @@ -68,7 +68,7 @@ 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 2022-06-01 func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +104,7 @@ 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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -116,7 +116,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 2022-06-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. @@ -135,7 +135,7 @@ 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 2022-06-01 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -171,7 +171,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ 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 2022-06-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. @@ -219,7 +219,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +237,7 @@ 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 2022-06-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. @@ -276,7 +276,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -293,7 +293,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 2022-06-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 +335,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,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 2022-06-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 +405,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,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 2022-06-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 +470,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +487,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 2022-06-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 +539,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -556,7 +556,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 2022-06-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 +609,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -626,7 +626,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 2022-06-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 +679,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -697,7 +697,7 @@ 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 2022-06-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 @@ -737,7 +737,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -755,7 +755,7 @@ 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 2022-06-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. @@ -794,7 +794,7 @@ 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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -806,7 +806,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 2022-06-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. @@ -825,7 +825,7 @@ 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 2022-06-01 func (client *MonitorsClient) update(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -861,7 +861,7 @@ 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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != 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..945fa8da702b 100644 --- a/sdk/resourcemanager/datadog/armdatadog/operations_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/operations_client.go @@ -38,9 +38,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 2022-06-01 api version. // -// Generated from API version 2021-03-01 +// Generated from API version 2022-06-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 +78,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", "2022-06-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/singlesignonconfigurations_client.go b/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go index 6eb9a2e5a54b..8e777387bad8 100644 --- a/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/singlesignonconfigurations_client.go @@ -47,7 +47,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 2022-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Configuration name @@ -70,7 +70,7 @@ 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 2022-06-01 func (client *SingleSignOnConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, configurationName string, options *SingleSignOnConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, configurationName, options) if err != nil { @@ -110,7 +110,7 @@ func (client *SingleSignOnConfigurationsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-03-01") + reqQP.Set("api-version", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -122,7 +122,7 @@ 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 2022-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - configurationName - Configuration name @@ -167,7 +167,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,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 2022-06-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 +237,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", "2022-06-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..619d1720ee4a 100644 --- a/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go +++ b/sdk/resourcemanager/datadog/armdatadog/tagrules_client.go @@ -47,7 +47,7 @@ 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 2022-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Rule set name @@ -91,7 +91,7 @@ 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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -112,7 +112,7 @@ 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 2022-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Monitor resource name // - ruleSetName - Rule set name @@ -156,7 +156,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", "2022-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,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 2022-06-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 +225,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", "2022-06-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{ - // }, - // }, - // }, - // } -}