diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/CHANGELOG.md b/sdk/resourcemanager/newrelic/armnewrelicobservability/CHANGELOG.md index c397e18528b4..6ab68cff2da8 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/CHANGELOG.md +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 1.1.0-beta.1 (2023-10-17) +### Features Added + +- New function `NewBillingInfoClient(string, azcore.TokenCredential, *arm.ClientOptions) (*BillingInfoClient, error)` +- New function `*BillingInfoClient.Get(context.Context, string, string, *BillingInfoClientGetOptions) (BillingInfoClientGetResponse, error)` +- New function `*ClientFactory.NewBillingInfoClient() *BillingInfoClient` +- New function `*ClientFactory.NewConnectedPartnerResourcesClient() *ConnectedPartnerResourcesClient` +- New function `NewConnectedPartnerResourcesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ConnectedPartnerResourcesClient, error)` +- New function `*ConnectedPartnerResourcesClient.NewListPager(string, string, *ConnectedPartnerResourcesClientListOptions) *runtime.Pager[ConnectedPartnerResourcesClientListResponse]` +- New struct `BillingInfoResponse` +- New struct `ConnectedPartnerResourceProperties` +- New struct `ConnectedPartnerResourcesListFormat` +- New struct `ConnectedPartnerResourcesListResponse` +- New struct `MarketplaceSaaSInfo` +- New struct `PartnerBillingEntity` + + ## 1.0.0 (2023-05-26) ### Features Added diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client.go index ecbabaa56a11..ebb33a61834d 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_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 armnewrelicobservability @@ -46,7 +45,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // NewListPager - List all the existing accounts // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - userEmail - User Email. // - location - Location for NewRelic. // - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. @@ -90,7 +89,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, userEmail s return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") reqQP.Set("userEmail", userEmail) reqQP.Set("location", location) req.Raw().URL.RawQuery = reqQP.Encode() diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client_example_test.go deleted file mode 100644 index 831703732cf7..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/accounts_client_example_test.go +++ /dev/null @@ -1,86 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MaximumSet_Gen.json -func ExampleAccountsClient_NewListPager_accountsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListPager("ruxvg@xqkmdhrnoo.hlmbpm", "egh", 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.AccountsListResponse = armnewrelicobservability.AccountsListResponse{ - // Value: []*armnewrelicobservability.AccountResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.AccountProperties{ - // AccountID: to.Ptr("igmdjq"), - // AccountName: to.Ptr("accname"), - // OrganizationID: to.Ptr("wvdclwi"), - // Region: to.Ptr("xnsylopqwcggudcln"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Accounts_List_MinimumSet_Gen.json -func ExampleAccountsClient_NewListPager_accountsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListPager("ruxvg@xqkmdhrnoo.hlmbpm", "egh", 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.AccountsListResponse = armnewrelicobservability.AccountsListResponse{ - // Value: []*armnewrelicobservability.AccountResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/autorest.md b/sdk/resourcemanager/newrelic/armnewrelicobservability/autorest.md index 15092a6a04be..fe5780c8446a 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/autorest.md +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/newrelic/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/newrelic/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2022-07-01 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/billinginfo_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/billinginfo_client.go new file mode 100644 index 000000000000..44d01487599b --- /dev/null +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/billinginfo_client.go @@ -0,0 +1,104 @@ +//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 armnewrelicobservability + +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" +) + +// BillingInfoClient contains the methods for the BillingInfo group. +// Don't use this type directly, use NewBillingInfoClient() instead. +type BillingInfoClient struct { + internal *arm.Client + subscriptionID string +} + +// NewBillingInfoClient creates a new instance of BillingInfoClient 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 NewBillingInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BillingInfoClient, error) { + cl, err := arm.NewClient(moduleName+".BillingInfoClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &BillingInfoClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get marketplace info mapped to the given monitor. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-10-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the Monitors resource +// - options - BillingInfoClientGetOptions contains the optional parameters for the BillingInfoClient.Get method. +func (client *BillingInfoClient) Get(ctx context.Context, resourceGroupName string, monitorName string, options *BillingInfoClientGetOptions) (BillingInfoClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, options) + if err != nil { + return BillingInfoClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BillingInfoClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BillingInfoClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *BillingInfoClient) getCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *BillingInfoClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/getBillingInfo" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-10-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *BillingInfoClient) getHandleResponse(resp *http.Response) (BillingInfoClientGetResponse, error) { + result := BillingInfoClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BillingInfoResponse); err != nil { + return BillingInfoClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/client_factory.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/client_factory.go index 699d33353939..a68453a7fbc0 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/client_factory.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -38,13 +37,18 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewAccountsClient() *AccountsClient { + subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAccountsClient() *AccountsClient { - subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBillingInfoClient() *BillingInfoClient { + subClient, _ := NewBillingInfoClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConnectedPartnerResourcesClient() *ConnectedPartnerResourcesClient { + subClient, _ := NewConnectedPartnerResourcesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -53,6 +57,11 @@ func (c *ClientFactory) NewMonitorsClient() *MonitorsClient { return subClient } +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOrganizationsClient() *OrganizationsClient { subClient, _ := NewOrganizationsClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/connectedpartnerresources_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/connectedpartnerresources_client.go new file mode 100644 index 000000000000..ec4015fcd3b7 --- /dev/null +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/connectedpartnerresources_client.go @@ -0,0 +1,115 @@ +//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 armnewrelicobservability + +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" +) + +// ConnectedPartnerResourcesClient contains the methods for the ConnectedPartnerResources group. +// Don't use this type directly, use NewConnectedPartnerResourcesClient() instead. +type ConnectedPartnerResourcesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewConnectedPartnerResourcesClient creates a new instance of ConnectedPartnerResourcesClient 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 NewConnectedPartnerResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedPartnerResourcesClient, error) { + cl, err := arm.NewClient(moduleName+".ConnectedPartnerResourcesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ConnectedPartnerResourcesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - List of all active deployments that are associated with the marketplace subscription linked to the given +// monitor. +// +// Generated from API version 2023-10-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - monitorName - Name of the Monitors resource +// - options - ConnectedPartnerResourcesClientListOptions contains the optional parameters for the ConnectedPartnerResourcesClient.NewListPager +// method. +func (client *ConnectedPartnerResourcesClient) NewListPager(resourceGroupName string, monitorName string, options *ConnectedPartnerResourcesClientListOptions) *runtime.Pager[ConnectedPartnerResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConnectedPartnerResourcesClientListResponse]{ + More: func(page ConnectedPartnerResourcesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ConnectedPartnerResourcesClientListResponse) (ConnectedPartnerResourcesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, monitorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ConnectedPartnerResourcesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ConnectedPartnerResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConnectedPartnerResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ConnectedPartnerResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, monitorName string, options *ConnectedPartnerResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/NewRelic.Observability/monitors/{monitorName}/listConnectedPartnerResources" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-10-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConnectedPartnerResourcesClient) listHandleResponse(resp *http.Response) (ConnectedPartnerResourcesClientListResponse, error) { + result := ConnectedPartnerResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectedPartnerResourcesListResponse); err != nil { + return ConnectedPartnerResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/constants.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/constants.go index 2016954a7f6c..cb611a0c0e71 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/constants.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability const ( moduleName = "armnewrelicobservability" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // AccountCreationSource - Source of Account creation diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/go.mod b/sdk/resourcemanager/newrelic/armnewrelicobservability/go.mod index d3c3dde473de..a40d1bb91b26 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/go.mod +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewreli 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/newrelic/armnewrelicobservability/go.sum b/sdk/resourcemanager/newrelic/armnewrelicobservability/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/go.sum +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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/newrelic/armnewrelicobservability/models.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/models.go index e6a75b2cf882..66c0271e60a5 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/models.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -19,7 +18,7 @@ type AccountInfo struct { // ingestion key of account IngestionKey *string - // NewRelic account region + // Region where New Relic account is present Region *string } @@ -34,7 +33,7 @@ type AccountProperties struct { // organization id OrganizationID *string - // region + // Region where New Relic account is present Region *string } @@ -71,11 +70,6 @@ type AccountResource struct { Type *string } -// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. -type AccountsClientListOptions struct { - // placeholder for future optional parameters -} - // AccountsListResponse - Response of get all accounts Operation. type AccountsListResponse struct { // REQUIRED; The AccountResource items on this page @@ -115,6 +109,45 @@ type AppServicesListResponse struct { NextLink *string } +// BillingInfoResponse - Marketplace Subscription and Organization details to which resource gets billed into. +type BillingInfoResponse struct { + // Marketplace Subscription details + MarketplaceSaasInfo *MarketplaceSaaSInfo + + // Partner Billing Entity details: Organization Info + PartnerBillingEntity *PartnerBillingEntity +} + +// ConnectedPartnerResourceProperties - Connected Partner Resource Properties +type ConnectedPartnerResourceProperties struct { + // NewRelic Account Id + AccountID *string + + // NewRelic account name + AccountName *string + + // The azure resource Id of the deployment. + AzureResourceID *string + + // The location of the deployment. + Location *string +} + +// ConnectedPartnerResourcesListFormat - Connected Partner Resources List Format +type ConnectedPartnerResourcesListFormat struct { + // Connected Partner Resource Properties + Properties *ConnectedPartnerResourceProperties +} + +// ConnectedPartnerResourcesListResponse - List of all active newrelic deployments. +type ConnectedPartnerResourcesListResponse struct { + // Link to the next set of results, if any. + NextLink *string + + // Results of a list operation. + Value []*ConnectedPartnerResourcesListFormat +} + // FilteringTag - The definition of a filtering tag. Filtering tags are used for capturing resources and include/exclude them // from being monitored. type FilteringTag struct { @@ -175,6 +208,24 @@ type ManagedServiceIdentity struct { TenantID *string } +// MarketplaceSaaSInfo - Marketplace SAAS Info of the resource. +type MarketplaceSaaSInfo struct { + // The Azure Subscription ID to which the Marketplace Subscription belongs and gets billed into. + BilledAzureSubscriptionID *string + + // Marketplace Subscription Details: Resource URI + MarketplaceResourceID *string + + // Marketplace Subscription Details: SaaS Subscription Status + MarketplaceStatus *string + + // Marketplace Subscription Id. This is a GUID-formatted string. + MarketplaceSubscriptionID *string + + // Marketplace Subscription Details: SAAS Name + MarketplaceSubscriptionName *string +} + // MetricRules - Set of rules for sending metrics for the Monitor resource. type MetricRules struct { // List of filtering tags to be used for capturing metrics. @@ -283,76 +334,6 @@ type MonitoringTagRulesProperties struct { ProvisioningState *ProvisioningState } -// MonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitorsClient.BeginCreateOrUpdate method. -type MonitorsClientBeginCreateOrUpdateOptions struct { - // 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 -} - -// MonitorsClientGetMetricRulesOptions contains the optional parameters for the MonitorsClient.GetMetricRules method. -type MonitorsClientGetMetricRulesOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientGetMetricStatusOptions contains the optional parameters for the MonitorsClient.GetMetricStatus method. -type MonitorsClientGetMetricStatusOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. -type MonitorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListAppServicesOptions contains the optional parameters for the MonitorsClient.NewListAppServicesPager method. -type MonitorsClientListAppServicesOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager -// method. -type MonitorsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListBySubscriptionOptions contains the optional parameters for the MonitorsClient.NewListBySubscriptionPager -// method. -type MonitorsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.NewListHostsPager method. -type MonitorsClientListHostsOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager -// method. -type MonitorsClientListMonitoredResourcesOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientSwitchBillingOptions contains the optional parameters for the MonitorsClient.SwitchBilling method. -type MonitorsClientSwitchBillingOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. -type MonitorsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// MonitorsClientVMHostPayloadOptions contains the optional parameters for the MonitorsClient.VMHostPayload method. -type MonitorsClientVMHostPayloadOptions struct { - // placeholder for future optional parameters -} - // NewRelicMonitorResource - A Monitor Resource by NewRelic type NewRelicMonitorResource struct { // REQUIRED; The geo-location where the resource lives @@ -483,11 +464,6 @@ type OperationListResult struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OrganizationInfo - Organization Info of the NewRelic account type OrganizationInfo struct { // Organization id @@ -524,11 +500,6 @@ type OrganizationResource struct { Type *string } -// OrganizationsClientListOptions contains the optional parameters for the OrganizationsClient.NewListPager method. -type OrganizationsClientListOptions struct { - // placeholder for future optional parameters -} - // OrganizationsListResponse - Response of get all organizations Operation. type OrganizationsListResponse struct { // REQUIRED; The OrganizationResource items on this page @@ -538,6 +509,15 @@ type OrganizationsListResponse struct { NextLink *string } +// PartnerBillingEntity - Partner Billing details associated with the resource. +type PartnerBillingEntity struct { + // The New Relic Organization Id. + OrganizationID *string + + // The New Relic Organization Name. + OrganizationName *string +} + // PlanData - Plan data of NewRelic Monitor resource type PlanData struct { // Different billing cycles like MONTHLY/WEEKLY. this could be enum @@ -592,14 +572,6 @@ type PlanDataResource struct { Type *string } -// PlansClientListOptions contains the optional parameters for the PlansClient.NewListPager method. -type PlansClientListOptions struct { - // Account Id. - AccountID *string - // Organization Id. - OrganizationID *string -} - // SwitchBillingRequest - Request of a switch billing Operation. type SwitchBillingRequest struct { // REQUIRED; User Email @@ -678,34 +650,6 @@ type TagRuleUpdateProperties struct { MetricRules *MetricRules } -// TagRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.BeginCreateOrUpdate method. -type TagRulesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// TagRulesClientBeginDeleteOptions contains the optional parameters for the TagRulesClient.BeginDelete method. -type TagRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. -type TagRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// TagRulesClientListByNewRelicMonitorResourceOptions contains the optional parameters for the TagRulesClient.NewListByNewRelicMonitorResourcePager -// method. -type TagRulesClientListByNewRelicMonitorResourceOptions struct { - // placeholder for future optional parameters -} - -// TagRulesClientUpdateOptions contains the optional parameters for the TagRulesClient.Update method. -type TagRulesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // UserAssignedIdentity - User assigned identity properties type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/models_serde.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/models_serde.go index 180114af1e53..2f7777507422 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/models_serde.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -300,6 +299,134 @@ func (a *AppServicesListResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BillingInfoResponse. +func (b BillingInfoResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "marketplaceSaasInfo", b.MarketplaceSaasInfo) + populate(objectMap, "partnerBillingEntity", b.PartnerBillingEntity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BillingInfoResponse. +func (b *BillingInfoResponse) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "marketplaceSaasInfo": + err = unpopulate(val, "MarketplaceSaasInfo", &b.MarketplaceSaasInfo) + delete(rawMsg, key) + case "partnerBillingEntity": + err = unpopulate(val, "PartnerBillingEntity", &b.PartnerBillingEntity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectedPartnerResourceProperties. +func (c ConnectedPartnerResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountId", c.AccountID) + populate(objectMap, "accountName", c.AccountName) + populate(objectMap, "azureResourceId", c.AzureResourceID) + populate(objectMap, "location", c.Location) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedPartnerResourceProperties. +func (c *ConnectedPartnerResourceProperties) 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 "accountId": + err = unpopulate(val, "AccountID", &c.AccountID) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &c.AccountName) + delete(rawMsg, key) + case "azureResourceId": + err = unpopulate(val, "AzureResourceID", &c.AzureResourceID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + 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 ConnectedPartnerResourcesListFormat. +func (c ConnectedPartnerResourcesListFormat) 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 ConnectedPartnerResourcesListFormat. +func (c *ConnectedPartnerResourcesListFormat) 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 ConnectedPartnerResourcesListResponse. +func (c ConnectedPartnerResourcesListResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedPartnerResourcesListResponse. +func (c *ConnectedPartnerResourcesListResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FilteringTag. func (f FilteringTag) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -444,6 +571,49 @@ func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MarketplaceSaaSInfo. +func (m MarketplaceSaaSInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "billedAzureSubscriptionId", m.BilledAzureSubscriptionID) + populate(objectMap, "marketplaceResourceId", m.MarketplaceResourceID) + populate(objectMap, "marketplaceStatus", m.MarketplaceStatus) + populate(objectMap, "marketplaceSubscriptionId", m.MarketplaceSubscriptionID) + populate(objectMap, "marketplaceSubscriptionName", m.MarketplaceSubscriptionName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceSaaSInfo. +func (m *MarketplaceSaaSInfo) 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 "billedAzureSubscriptionId": + err = unpopulate(val, "BilledAzureSubscriptionID", &m.BilledAzureSubscriptionID) + delete(rawMsg, key) + case "marketplaceResourceId": + err = unpopulate(val, "MarketplaceResourceID", &m.MarketplaceResourceID) + delete(rawMsg, key) + case "marketplaceStatus": + err = unpopulate(val, "MarketplaceStatus", &m.MarketplaceStatus) + delete(rawMsg, key) + case "marketplaceSubscriptionId": + err = unpopulate(val, "MarketplaceSubscriptionID", &m.MarketplaceSubscriptionID) + delete(rawMsg, key) + case "marketplaceSubscriptionName": + err = unpopulate(val, "MarketplaceSubscriptionName", &m.MarketplaceSubscriptionName) + 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 MetricRules. func (m MetricRules) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1192,6 +1362,37 @@ func (o *OrganizationsListResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PartnerBillingEntity. +func (p PartnerBillingEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "organizationId", p.OrganizationID) + populate(objectMap, "organizationName", p.OrganizationName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerBillingEntity. +func (p *PartnerBillingEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "organizationId": + err = unpopulate(val, "OrganizationID", &p.OrganizationID) + delete(rawMsg, key) + case "organizationName": + err = unpopulate(val, "OrganizationName", &p.OrganizationName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PlanData. func (p PlanData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client.go index eddf1f068676..d9367c14d2ab 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -48,7 +47,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - resource - Resource create parameters. @@ -60,9 +59,10 @@ func (client *MonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *MonitorsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview func (client *MonitorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, resource NewRelicMonitorResource, options *MonitorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, resource, 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. @@ -107,16 +109,19 @@ func (client *MonitorsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - userEmail - User Email. // - monitorName - Name of the Monitors resource @@ -127,9 +132,10 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitorsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,20 +144,22 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, userEmail string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, userEmail, 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. @@ -174,7 +182,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") reqQP.Set("userEmail", userEmail) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -184,23 +192,26 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - 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. @@ -223,7 +234,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,24 +252,27 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl // GetMetricRules - Get metric rules // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - request - The details of the get metrics status request. // - options - MonitorsClientGetMetricRulesOptions contains the optional parameters for the MonitorsClient.GetMetricRules method. func (client *MonitorsClient) GetMetricRules(ctx context.Context, resourceGroupName string, monitorName string, request MetricsRequest, options *MonitorsClientGetMetricRulesOptions) (MonitorsClientGetMetricRulesResponse, error) { + var err error req, err := client.getMetricRulesCreateRequest(ctx, resourceGroupName, monitorName, request, options) if err != nil { return MonitorsClientGetMetricRulesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientGetMetricRulesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientGetMetricRulesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientGetMetricRulesResponse{}, err } - return client.getMetricRulesHandleResponse(resp) + resp, err := client.getMetricRulesHandleResponse(httpResp) + return resp, err } // getMetricRulesCreateRequest creates the GetMetricRules request. @@ -281,10 +295,13 @@ func (client *MonitorsClient) getMetricRulesCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // getMetricRulesHandleResponse handles the GetMetricRules response. @@ -299,25 +316,28 @@ func (client *MonitorsClient) getMetricRulesHandleResponse(resp *http.Response) // GetMetricStatus - Get metric status // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - request - The details of the get metrics status request. // - options - MonitorsClientGetMetricStatusOptions contains the optional parameters for the MonitorsClient.GetMetricStatus // method. func (client *MonitorsClient) GetMetricStatus(ctx context.Context, resourceGroupName string, monitorName string, request MetricsStatusRequest, options *MonitorsClientGetMetricStatusOptions) (MonitorsClientGetMetricStatusResponse, error) { + var err error req, err := client.getMetricStatusCreateRequest(ctx, resourceGroupName, monitorName, request, options) if err != nil { return MonitorsClientGetMetricStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientGetMetricStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientGetMetricStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientGetMetricStatusResponse{}, err } - return client.getMetricStatusHandleResponse(resp) + resp, err := client.getMetricStatusHandleResponse(httpResp) + return resp, err } // getMetricStatusCreateRequest creates the GetMetricStatus request. @@ -340,10 +360,13 @@ func (client *MonitorsClient) getMetricStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // getMetricStatusHandleResponse handles the GetMetricStatus response. @@ -357,7 +380,7 @@ func (client *MonitorsClient) getMetricStatusHandleResponse(resp *http.Response) // NewListAppServicesPager - List the app service resources currently being monitored by the NewRelic resource. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - request - The details of the app services get request. @@ -411,10 +434,13 @@ func (client *MonitorsClient) listAppServicesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // listAppServicesHandleResponse handles the ListAppServices response. @@ -428,7 +454,7 @@ func (client *MonitorsClient) listAppServicesHandleResponse(resp *http.Response) // NewListByResourceGroupPager - List NewRelicMonitorResource resources by resource group // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager // method. @@ -476,7 +502,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -493,7 +519,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - List NewRelicMonitorResource resources by subscription ID // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - options - MonitorsClientListBySubscriptionOptions contains the optional parameters for the MonitorsClient.NewListBySubscriptionPager // method. func (client *MonitorsClient) NewListBySubscriptionPager(options *MonitorsClientListBySubscriptionOptions) *runtime.Pager[MonitorsClientListBySubscriptionResponse] { @@ -536,7 +562,7 @@ func (client *MonitorsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -553,7 +579,7 @@ func (client *MonitorsClient) listBySubscriptionHandleResponse(resp *http.Respon // NewListHostsPager - List the compute vm resources currently being monitored by the NewRelic resource. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - request - The details of the Hosts get request. @@ -606,10 +632,13 @@ func (client *MonitorsClient) listHostsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // listHostsHandleResponse handles the ListHosts response. @@ -623,7 +652,7 @@ func (client *MonitorsClient) listHostsHandleResponse(resp *http.Response) (Moni // NewListMonitoredResourcesPager - List the resources currently being monitored by the NewRelic monitor resource. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - options - MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager @@ -676,7 +705,7 @@ func (client *MonitorsClient) listMonitoredResourcesCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -694,24 +723,27 @@ func (client *MonitorsClient) listMonitoredResourcesHandleResponse(resp *http.Re // SwitchBilling - Switches the billing for NewRelic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - request - The details of the switch billing request. // - options - MonitorsClientSwitchBillingOptions contains the optional parameters for the MonitorsClient.SwitchBilling method. func (client *MonitorsClient) SwitchBilling(ctx context.Context, resourceGroupName string, monitorName string, request SwitchBillingRequest, options *MonitorsClientSwitchBillingOptions) (MonitorsClientSwitchBillingResponse, error) { + var err error req, err := client.switchBillingCreateRequest(ctx, resourceGroupName, monitorName, request, options) if err != nil { return MonitorsClientSwitchBillingResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientSwitchBillingResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return MonitorsClientSwitchBillingResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientSwitchBillingResponse{}, err } - return client.switchBillingHandleResponse(resp) + resp, err := client.switchBillingHandleResponse(httpResp) + return resp, err } // switchBillingCreateRequest creates the SwitchBilling request. @@ -734,10 +766,13 @@ func (client *MonitorsClient) switchBillingCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, request) + if err := runtime.MarshalAsJSON(req, request); err != nil { + return nil, err + } + return req, nil } // switchBillingHandleResponse handles the SwitchBilling response. @@ -760,24 +795,27 @@ func (client *MonitorsClient) switchBillingHandleResponse(resp *http.Response) ( // Update - Update a NewRelicMonitorResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - properties - The resource properties to be updated. // - options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. func (client *MonitorsClient) Update(ctx context.Context, resourceGroupName string, monitorName string, properties NewRelicMonitorResourceUpdate, options *MonitorsClientUpdateOptions) (MonitorsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, properties, options) if err != nil { return MonitorsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -800,10 +838,13 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. @@ -818,23 +859,26 @@ func (client *MonitorsClient) updateHandleResponse(resp *http.Response) (Monitor // VMHostPayload - Returns the payload that needs to be passed in the request body for installing NewRelic agent on a VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - options - MonitorsClientVMHostPayloadOptions contains the optional parameters for the MonitorsClient.VMHostPayload method. func (client *MonitorsClient) VMHostPayload(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientVMHostPayloadOptions) (MonitorsClientVMHostPayloadResponse, error) { + var err error req, err := client.vmHostPayloadCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { return MonitorsClientVMHostPayloadResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitorsClientVMHostPayloadResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitorsClientVMHostPayloadResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitorsClientVMHostPayloadResponse{}, err } - return client.vmHostPayloadHandleResponse(resp) + resp, err := client.vmHostPayloadHandleResponse(httpResp) + return resp, err } // vmHostPayloadCreateRequest creates the VMHostPayload request. @@ -857,7 +901,7 @@ func (client *MonitorsClient) vmHostPayloadCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client_example_test.go deleted file mode 100644 index 757a4deefd49..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/monitors_client_example_test.go +++ /dev/null @@ -1,1139 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListBySubscription_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListBySubscriptionPager(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.NewRelicMonitorResourceListResult = armnewrelicobservability.NewRelicMonitorResourceListResult{ - // Value: []*armnewrelicobservability.NewRelicMonitorResource{ - // { - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListByResourceGroup_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListByResourceGroupPager("rgNewRelic", 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.NewRelicMonitorResourceListResult = armnewrelicobservability.NewRelicMonitorResourceListResult{ - // Value: []*armnewrelicobservability.NewRelicMonitorResource{ - // { - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Get_MaximumSet_Gen.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Get(ctx, "rgNewRelic", "cdlymktqw", 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.NewRelicMonitorResource = armnewrelicobservability.NewRelicMonitorResource{ - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_CreateOrUpdate_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginCreateOrUpdate(ctx, "rgNewRelic", "cdlymktqw", armnewrelicobservability.NewRelicMonitorResource{ - Location: to.Ptr("k"), - Tags: map[string]*string{ - "key6976": to.Ptr("oaxfhf"), - }, - Properties: &armnewrelicobservability.MonitorProperties{ - AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - AccountInfo: &armnewrelicobservability.AccountInfo{ - AccountID: to.Ptr("xhqmg"), - IngestionKey: to.Ptr("wltnimmhqt"), - Region: to.Ptr("ljcf"), - }, - OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - OrganizationID: to.Ptr("k"), - }, - SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - EnterpriseAppID: to.Ptr("kwiwfz"), - ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateAccepted), - SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - }, - UserID: to.Ptr("vcscxlncofcuduadesd"), - }, - OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - PlanData: &armnewrelicobservability.PlanData{ - BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t }()), - PlanDetails: to.Ptr("tbbiaga"), - UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - }, - ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateAccepted), - UserInfo: &armnewrelicobservability.UserInfo{ - Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - PhoneNumber: to.Ptr("krf"), - }, - }, - }, 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.NewRelicMonitorResource = armnewrelicobservability.NewRelicMonitorResource{ - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Update_MaximumSet_Gen.json -func ExampleMonitorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().Update(ctx, "rgNewRelic", "cdlymktqw", armnewrelicobservability.NewRelicMonitorResourceUpdate{ - Identity: &armnewrelicobservability.ManagedServiceIdentity{ - Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - "key8903": {}, - }, - }, - Properties: &armnewrelicobservability.NewRelicMonitorResourceUpdateProperties{ - AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - AccountInfo: &armnewrelicobservability.AccountInfo{ - AccountID: to.Ptr("xhqmg"), - IngestionKey: to.Ptr("wltnimmhqt"), - Region: to.Ptr("ljcf"), - }, - OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - OrganizationID: to.Ptr("k"), - }, - SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - EnterpriseAppID: to.Ptr("kwiwfz"), - ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateAccepted), - SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - }, - UserID: to.Ptr("vcscxlncofcuduadesd"), - }, - OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - PlanData: &armnewrelicobservability.PlanData{ - BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t }()), - PlanDetails: to.Ptr("tbbiaga"), - UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - }, - UserInfo: &armnewrelicobservability.UserInfo{ - Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - PhoneNumber: to.Ptr("krf"), - }, - }, - Tags: map[string]*string{ - "key164": to.Ptr("jqakdrrmmyzytqu"), - }, - }, 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.NewRelicMonitorResource = armnewrelicobservability.NewRelicMonitorResource{ - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MaximumSet_Gen.json -func ExampleMonitorsClient_BeginDelete_monitorsDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginDelete(ctx, "rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_Delete_MinimumSet_Gen.json -func ExampleMonitorsClient_BeginDelete_monitorsDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitorsClient().BeginDelete(ctx, "rgopenapi", "ruxvg@xqkmdhrnoo.hlmbpm", "ipxmlcbonyxtolzejcjshkmlron", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MaximumSet_Gen.json -func ExampleMonitorsClient_GetMetricRules_monitorsGetMetricRulesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetMetricRules(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.MetricsRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.MetricRules = armnewrelicobservability.MetricRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("qnvixg"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("ihyabcsjvhkfzckfjvgvtlhdyvmwge"), - // }}, - // SendMetrics: to.Ptr(armnewrelicobservability.SendMetricsStatusEnabled), - // UserEmail: to.Ptr("test@testing.com"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricRules_MinimumSet_Gen.json -func ExampleMonitorsClient_GetMetricRules_monitorsGetMetricRulesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetMetricRules(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.MetricsRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.MetricRules = armnewrelicobservability.MetricRules{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MaximumSet_Gen.json -func ExampleMonitorsClient_GetMetricStatus_monitorsGetMetricStatusMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetMetricStatus(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.MetricsStatusRequest{ - AzureResourceIDs: []*string{ - to.Ptr("enfghpfw")}, - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.MetricsStatusResponse = armnewrelicobservability.MetricsStatusResponse{ - // AzureResourceIDs: []*string{ - // to.Ptr("enfghpfw")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_GetMetricStatus_MinimumSet_Gen.json -func ExampleMonitorsClient_GetMetricStatus_monitorsGetMetricStatusMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().GetMetricStatus(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.MetricsStatusRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.MetricsStatusResponse = armnewrelicobservability.MetricsStatusResponse{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListAppServicesPager_monitorsListAppServicesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListAppServicesPager("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.AppServicesGetRequest{ - AzureResourceIDs: []*string{ - to.Ptr("pvzrksrmzowobuhxpwiotnpcvjbu")}, - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.AppServicesListResponse = armnewrelicobservability.AppServicesListResponse{ - // Value: []*armnewrelicobservability.AppServiceInfo{ - // { - // AgentStatus: to.Ptr("vclwfecbppsfaygdccfu"), - // AgentVersion: to.Ptr("owxkssnbp"), - // AzureResourceID: to.Ptr("kjvbkwuqmouugrrz"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListAppServices_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListAppServicesPager_monitorsListAppServicesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListAppServicesPager("rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.AppServicesGetRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.AppServicesListResponse = armnewrelicobservability.AppServicesListResponse{ - // Value: []*armnewrelicobservability.AppServiceInfo{ - // { - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MaximumSet_Gen.json -func ExampleMonitorsClient_SwitchBilling_monitorsSwitchBillingMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().SwitchBilling(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.SwitchBillingRequest{ - AzureResourceID: to.Ptr("enfghpfw"), - OrganizationID: to.Ptr("k"), - PlanData: &armnewrelicobservability.PlanData{ - BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t }()), - PlanDetails: to.Ptr("tbbiaga"), - UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - }, - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.NewRelicMonitorResource = armnewrelicobservability.NewRelicMonitorResource{ - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_SwitchBilling_MinimumSet_Gen.json -func ExampleMonitorsClient_SwitchBilling_monitorsSwitchBillingMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().SwitchBilling(ctx, "rgNewRelic", "fhcjxnxumkdlgpwanewtkdnyuz", armnewrelicobservability.SwitchBillingRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - }, 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.NewRelicMonitorResource = armnewrelicobservability.NewRelicMonitorResource{ - // Name: to.Ptr("fteaqmtwspcfgyopqzrepiqu"), - // Type: to.Ptr("hdj"), - // ID: to.Ptr("ilrwkvbuwu"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // CreatedBy: to.Ptr("pcdjzdldbwsdlfi"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.787Z"); return t}()), - // LastModifiedBy: to.Ptr("xbsjrxmwwlmpnpvcica"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Location: to.Ptr("k"), - // Tags: map[string]*string{ - // "key6976": to.Ptr("oaxfhf"), - // }, - // Identity: &armnewrelicobservability.ManagedServiceIdentity{ - // Type: to.Ptr(armnewrelicobservability.ManagedServiceIdentityTypeNone), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // TenantID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // UserAssignedIdentities: map[string]*armnewrelicobservability.UserAssignedIdentity{ - // "key8903": &armnewrelicobservability.UserAssignedIdentity{ - // ClientID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // PrincipalID: to.Ptr("cac47a92-2856-11ed-a261-0242ac120002"), - // }, - // }, - // }, - // Properties: &armnewrelicobservability.MonitorProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // LiftrResourceCategory: to.Ptr(armnewrelicobservability.LiftrResourceCategoriesUnknown), - // LiftrResourcePreference: to.Ptr[int32](12), - // MarketplaceSubscriptionID: to.Ptr("jizcsbgrdjhrfqqvvruhgftqhra"), - // MarketplaceSubscriptionStatus: to.Ptr(armnewrelicobservability.MarketplaceSubscriptionStatusActive), - // MonitoringStatus: to.Ptr(armnewrelicobservability.MonitoringStatusEnabled), - // NewRelicAccountProperties: &armnewrelicobservability.AccountPropertiesForNewRelic{ - // AccountInfo: &armnewrelicobservability.AccountInfo{ - // AccountID: to.Ptr("xhqmg"), - // Region: to.Ptr("ljcf"), - // }, - // OrganizationInfo: &armnewrelicobservability.OrganizationInfo{ - // OrganizationID: to.Ptr("k"), - // }, - // SingleSignOnProperties: &armnewrelicobservability.NewRelicSingleSignOnProperties{ - // EnterpriseAppID: to.Ptr("kwiwfz"), - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // SingleSignOnState: to.Ptr(armnewrelicobservability.SingleSignOnStatesInitial), - // SingleSignOnURL: to.Ptr("kvseueuljsxmfwpqctz"), - // }, - // UserID: to.Ptr("vcscxlncofcuduadesd"), - // }, - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // UserInfo: &armnewrelicobservability.UserInfo{ - // Country: to.Ptr("hslqnwdanrconqyekwbnttaetv"), - // EmailAddress: to.Ptr("%6%@4-g.N1.3F-kI1.Ue-.lJso"), - // FirstName: to.Ptr("vdftzcggirefejajwahhwhyibutramdaotvnuf"), - // LastName: to.Ptr("bcsztgqovdlmzfkjdrngidwzqsevagexzzilnlc"), - // PhoneNumber: to.Ptr("krf"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListHostsPager_monitorsListHostsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListHostsPager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", armnewrelicobservability.HostsGetRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - VMIDs: []*string{ - to.Ptr("xzphvxvfmvjrnsgyns")}, - }, 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.VMHostsListResponse = armnewrelicobservability.VMHostsListResponse{ - // Value: []*armnewrelicobservability.VMInfo{ - // { - // AgentStatus: to.Ptr("psnjslxwuwtviwzzgqhyzynuxvz"), - // AgentVersion: to.Ptr("tbinulnoozxnbr"), - // VMID: to.Ptr("gwyoa"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListHosts_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListHostsPager_monitorsListHostsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListHostsPager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", armnewrelicobservability.HostsGetRequest{ - UserEmail: to.Ptr("ruxvg@xqkmdhrnoo.hlmbpm"), - VMIDs: []*string{ - to.Ptr("xzphvxvfmvjrnsgyns")}, - }, 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.VMHostsListResponse = armnewrelicobservability.VMHostsListResponse{ - // Value: []*armnewrelicobservability.VMInfo{ - // { - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MaximumSet_Gen.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager_monitorsListMonitoredResourcesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListMonitoredResourcesPager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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 = armnewrelicobservability.MonitoredResourceListResponse{ - // Value: []*armnewrelicobservability.MonitoredResource{ - // { - // ID: to.Ptr("qmtrcoxuctyphc"), - // ReasonForLogsStatus: to.Ptr("agzxviwuxgr"), - // ReasonForMetricsStatus: to.Ptr("k"), - // SendingLogs: to.Ptr(armnewrelicobservability.SendingLogsStatusEnabled), - // SendingMetrics: to.Ptr(armnewrelicobservability.SendingMetricsStatusEnabled), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_ListMonitoredResources_MinimumSet_Gen.json -func ExampleMonitorsClient_NewListMonitoredResourcesPager_monitorsListMonitoredResourcesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMonitorsClient().NewListMonitoredResourcesPager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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 = armnewrelicobservability.MonitoredResourceListResponse{ - // Value: []*armnewrelicobservability.MonitoredResource{ - // { - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MaximumSet_Gen.json -func ExampleMonitorsClient_VMHostPayload_monitorsVmHostPayloadMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().VMHostPayload(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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.VMExtensionPayload = armnewrelicobservability.VMExtensionPayload{ - // IngestionKey: to.Ptr("ltqewhfexphvqgttoevaywrl"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Monitors_VmHostPayload_MinimumSet_Gen.json -func ExampleMonitorsClient_VMHostPayload_monitorsVmHostPayloadMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitorsClient().VMHostPayload(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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.VMExtensionPayload = armnewrelicobservability.VMExtensionPayload{ - // IngestionKey: to.Ptr("ltqewhfexphvqgttoevaywrl"), - // } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client.go index f7ac8d605349..60c10199e114 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - 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", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client_example_test.go deleted file mode 100644 index 80aac7f67eae..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/operations_client_example_test.go +++ /dev/null @@ -1,85 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.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 = armnewrelicobservability.OperationListResult{ - // Value: []*armnewrelicobservability.Operation{ - // { - // Name: to.Ptr("zhlrjcljiysnufaerhpzg"), - // ActionType: to.Ptr(armnewrelicobservability.ActionTypeInternal), - // Display: &armnewrelicobservability.OperationDisplay{ - // Description: to.Ptr("sekhimcuecttketh"), - // Operation: to.Ptr("ybyzweygkffbydgaowg"), - // Provider: to.Ptr("v"), - // Resource: to.Ptr("w"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armnewrelicobservability.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.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 = armnewrelicobservability.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/options.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/options.go new file mode 100644 index 000000000000..a9f691e860d5 --- /dev/null +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/options.go @@ -0,0 +1,142 @@ +//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 armnewrelicobservability + +// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. +type AccountsClientListOptions struct { + // placeholder for future optional parameters +} + +// BillingInfoClientGetOptions contains the optional parameters for the BillingInfoClient.Get method. +type BillingInfoClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectedPartnerResourcesClientListOptions contains the optional parameters for the ConnectedPartnerResourcesClient.NewListPager +// method. +type ConnectedPartnerResourcesClientListOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientBeginCreateOrUpdateOptions contains the optional parameters for the MonitorsClient.BeginCreateOrUpdate method. +type MonitorsClientBeginCreateOrUpdateOptions struct { + // 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 +} + +// MonitorsClientGetMetricRulesOptions contains the optional parameters for the MonitorsClient.GetMetricRules method. +type MonitorsClientGetMetricRulesOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientGetMetricStatusOptions contains the optional parameters for the MonitorsClient.GetMetricStatus method. +type MonitorsClientGetMetricStatusOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. +type MonitorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListAppServicesOptions contains the optional parameters for the MonitorsClient.NewListAppServicesPager method. +type MonitorsClientListAppServicesOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. +type MonitorsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListBySubscriptionOptions contains the optional parameters for the MonitorsClient.NewListBySubscriptionPager +// method. +type MonitorsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListHostsOptions contains the optional parameters for the MonitorsClient.NewListHostsPager method. +type MonitorsClientListHostsOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientListMonitoredResourcesOptions contains the optional parameters for the MonitorsClient.NewListMonitoredResourcesPager +// method. +type MonitorsClientListMonitoredResourcesOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientSwitchBillingOptions contains the optional parameters for the MonitorsClient.SwitchBilling method. +type MonitorsClientSwitchBillingOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. +type MonitorsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// MonitorsClientVMHostPayloadOptions contains the optional parameters for the MonitorsClient.VMHostPayload method. +type MonitorsClientVMHostPayloadOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OrganizationsClientListOptions contains the optional parameters for the OrganizationsClient.NewListPager method. +type OrganizationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PlansClientListOptions contains the optional parameters for the PlansClient.NewListPager method. +type PlansClientListOptions struct { + // Account Id. + AccountID *string + + // Organization Id. + OrganizationID *string +} + +// TagRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.BeginCreateOrUpdate method. +type TagRulesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TagRulesClientBeginDeleteOptions contains the optional parameters for the TagRulesClient.BeginDelete method. +type TagRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. +type TagRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// TagRulesClientListByNewRelicMonitorResourceOptions contains the optional parameters for the TagRulesClient.NewListByNewRelicMonitorResourcePager +// method. +type TagRulesClientListByNewRelicMonitorResourceOptions struct { + // placeholder for future optional parameters +} + +// TagRulesClientUpdateOptions contains the optional parameters for the TagRulesClient.Update method. +type TagRulesClientUpdateOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client.go index d20a7ba2c912..37ab7f9a6016 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_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 armnewrelicobservability @@ -46,7 +45,7 @@ func NewOrganizationsClient(subscriptionID string, credential azcore.TokenCreden // NewListPager - List all the existing organizations // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - userEmail - User Email. // - location - Location for NewRelic. // - options - OrganizationsClientListOptions contains the optional parameters for the OrganizationsClient.NewListPager method. @@ -90,7 +89,7 @@ func (client *OrganizationsClient) listCreateRequest(ctx context.Context, userEm return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") reqQP.Set("userEmail", userEmail) reqQP.Set("location", location) req.Raw().URL.RawQuery = reqQP.Encode() diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client_example_test.go deleted file mode 100644 index 93d09f5fb0c3..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/organizations_client_example_test.go +++ /dev/null @@ -1,85 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MaximumSet_Gen.json -func ExampleOrganizationsClient_NewListPager_organizationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOrganizationsClient().NewListPager("ruxvg@xqkmdhrnoo.hlmbpm", "egh", 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.OrganizationsListResponse = armnewrelicobservability.OrganizationsListResponse{ - // Value: []*armnewrelicobservability.OrganizationResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.OrganizationProperties{ - // BillingSource: to.Ptr(armnewrelicobservability.BillingSourceAZURE), - // OrganizationID: to.Ptr("tjmcifofzirili"), - // OrganizationName: to.Ptr("orgname"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Organizations_List_MinimumSet_Gen.json -func ExampleOrganizationsClient_NewListPager_organizationsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOrganizationsClient().NewListPager("ruxvg@xqkmdhrnoo.hlmbpm", "egh", 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.OrganizationsListResponse = armnewrelicobservability.OrganizationsListResponse{ - // Value: []*armnewrelicobservability.OrganizationResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client.go index f67f7bbd325b..cb0274011c22 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_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 armnewrelicobservability @@ -46,7 +45,7 @@ func NewPlansClient(subscriptionID string, credential azcore.TokenCredential, op // NewListPager - List plans data // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - options - PlansClientListOptions contains the optional parameters for the PlansClient.NewListPager method. func (client *PlansClient) NewListPager(options *PlansClientListOptions) *runtime.Pager[PlansClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PlansClientListResponse]{ @@ -88,7 +87,7 @@ func (client *PlansClient) listCreateRequest(ctx context.Context, options *Plans return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") if options != nil && options.AccountID != nil { reqQP.Set("accountId", *options.AccountID) } diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client_example_test.go deleted file mode 100644 index 2b090a4df05f..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/plans_client_example_test.go +++ /dev/null @@ -1,95 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MaximumSet_Gen.json -func ExamplePlansClient_NewListPager_plansListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPlansClient().NewListPager(&armnewrelicobservability.PlansClientListOptions{AccountID: to.Ptr("pwuxgvrmkk"), - OrganizationID: to.Ptr("hilawwjz"), - }) - 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.PlanDataListResponse = armnewrelicobservability.PlanDataListResponse{ - // Value: []*armnewrelicobservability.PlanDataResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.PlanDataProperties{ - // AccountCreationSource: to.Ptr(armnewrelicobservability.AccountCreationSourceLIFTR), - // OrgCreationSource: to.Ptr(armnewrelicobservability.OrgCreationSourceLIFTR), - // PlanData: &armnewrelicobservability.PlanData{ - // BillingCycle: to.Ptr(armnewrelicobservability.BillingCycleYEARLY), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-12-05T14:11:37.786Z"); return t}()), - // PlanDetails: to.Ptr("tbbiaga"), - // UsageType: to.Ptr(armnewrelicobservability.UsageTypePAYG), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/Plans_List_MinimumSet_Gen.json -func ExamplePlansClient_NewListPager_plansListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPlansClient().NewListPager(&armnewrelicobservability.PlansClientListOptions{AccountID: nil, - OrganizationID: 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.PlanDataListResponse = armnewrelicobservability.PlanDataListResponse{ - // Value: []*armnewrelicobservability.PlanDataResource{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/response_types.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/response_types.go index a5e09f904046..f12fcfe4567e 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/response_types.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/response_types.go @@ -3,19 +3,32 @@ // 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 armnewrelicobservability // AccountsClientListResponse contains the response from method AccountsClient.NewListPager. type AccountsClientListResponse struct { + // Response of get all accounts Operation. AccountsListResponse } +// BillingInfoClientGetResponse contains the response from method BillingInfoClient.Get. +type BillingInfoClientGetResponse struct { + // Marketplace Subscription and Organization details to which resource gets billed into. + BillingInfoResponse +} + +// ConnectedPartnerResourcesClientListResponse contains the response from method ConnectedPartnerResourcesClient.NewListPager. +type ConnectedPartnerResourcesClientListResponse struct { + // List of all active newrelic deployments. + ConnectedPartnerResourcesListResponse +} + // MonitorsClientCreateOrUpdateResponse contains the response from method MonitorsClient.BeginCreateOrUpdate. type MonitorsClientCreateOrUpdateResponse struct { + // A Monitor Resource by NewRelic NewRelicMonitorResource } @@ -26,78 +39,94 @@ type MonitorsClientDeleteResponse struct { // MonitorsClientGetMetricRulesResponse contains the response from method MonitorsClient.GetMetricRules. type MonitorsClientGetMetricRulesResponse struct { + // Set of rules for sending metrics for the Monitor resource. MetricRules } // MonitorsClientGetMetricStatusResponse contains the response from method MonitorsClient.GetMetricStatus. type MonitorsClientGetMetricStatusResponse struct { + // Response of get metrics status Operation. MetricsStatusResponse } // MonitorsClientGetResponse contains the response from method MonitorsClient.Get. type MonitorsClientGetResponse struct { + // A Monitor Resource by NewRelic NewRelicMonitorResource } // MonitorsClientListAppServicesResponse contains the response from method MonitorsClient.NewListAppServicesPager. type MonitorsClientListAppServicesResponse struct { + // Response of a list app services Operation. AppServicesListResponse } // MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.NewListByResourceGroupPager. type MonitorsClientListByResourceGroupResponse struct { + // The response of a NewRelicMonitorResource list operation. NewRelicMonitorResourceListResult } // MonitorsClientListBySubscriptionResponse contains the response from method MonitorsClient.NewListBySubscriptionPager. type MonitorsClientListBySubscriptionResponse struct { + // The response of a NewRelicMonitorResource list operation. NewRelicMonitorResourceListResult } // MonitorsClientListHostsResponse contains the response from method MonitorsClient.NewListHostsPager. type MonitorsClientListHostsResponse struct { + // Response of a list VM Host Operation. VMHostsListResponse } // MonitorsClientListMonitoredResourcesResponse contains the response from method MonitorsClient.NewListMonitoredResourcesPager. type MonitorsClientListMonitoredResourcesResponse struct { + // List of all the resources being monitored by NewRelic monitor resource MonitoredResourceListResponse } // MonitorsClientSwitchBillingResponse contains the response from method MonitorsClient.SwitchBilling. type MonitorsClientSwitchBillingResponse struct { + // A Monitor Resource by NewRelic NewRelicMonitorResource + // RetryAfter contains the information returned from the Retry-After header response. RetryAfter *int32 } // MonitorsClientUpdateResponse contains the response from method MonitorsClient.Update. type MonitorsClientUpdateResponse struct { + // A Monitor Resource by NewRelic NewRelicMonitorResource } // MonitorsClientVMHostPayloadResponse contains the response from method MonitorsClient.VMHostPayload. type MonitorsClientVMHostPayloadResponse struct { + // Response of payload to be passed while installing VM agent. VMExtensionPayload } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } // OrganizationsClientListResponse contains the response from method OrganizationsClient.NewListPager. type OrganizationsClientListResponse struct { + // Response of get all organizations Operation. OrganizationsListResponse } // PlansClientListResponse contains the response from method PlansClient.NewListPager. type PlansClientListResponse struct { + // Response of get all plan data Operation. PlanDataListResponse } // TagRulesClientCreateOrUpdateResponse contains the response from method TagRulesClient.BeginCreateOrUpdate. type TagRulesClientCreateOrUpdateResponse struct { + // A tag rule belonging to NewRelic account TagRule } @@ -108,15 +137,18 @@ type TagRulesClientDeleteResponse struct { // TagRulesClientGetResponse contains the response from method TagRulesClient.Get. type TagRulesClientGetResponse struct { + // A tag rule belonging to NewRelic account TagRule } // TagRulesClientListByNewRelicMonitorResourceResponse contains the response from method TagRulesClient.NewListByNewRelicMonitorResourcePager. type TagRulesClientListByNewRelicMonitorResourceResponse struct { + // The response of a TagRule list operation. TagRuleListResult } // TagRulesClientUpdateResponse contains the response from method TagRulesClient.Update. type TagRulesClientUpdateResponse struct { + // A tag rule belonging to NewRelic account TagRule } diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client.go index 81b221d83b3e..292ddafaf9b8 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability @@ -47,7 +46,7 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - ruleSetName - Name of the TagRule @@ -60,9 +59,10 @@ func (client *TagRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TagRulesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TagRulesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[TagRulesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *TagRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview func (client *TagRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, resource TagRule, options *TagRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, resource, 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. @@ -111,16 +113,19 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - ruleSetName - Name of the TagRule @@ -131,9 +136,10 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TagRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TagRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[TagRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview func (client *TagRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, 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. @@ -182,7 +190,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,24 +199,27 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - ruleSetName - Name of the TagRule // - 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. @@ -235,7 +246,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,7 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl // NewListByNewRelicMonitorResourcePager - List TagRule resources by NewRelicMonitorResource // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - options - TagRulesClientListByNewRelicMonitorResourceOptions contains the optional parameters for the TagRulesClient.NewListByNewRelicMonitorResourcePager @@ -305,7 +316,7 @@ func (client *TagRulesClient) listByNewRelicMonitorResourceCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,25 +334,28 @@ func (client *TagRulesClient) listByNewRelicMonitorResourceHandleResponse(resp * // Update - Update a TagRule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-07-01 +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the Monitors resource // - ruleSetName - Name of the TagRule // - properties - The resource properties to be updated. // - options - TagRulesClientUpdateOptions contains the optional parameters for the TagRulesClient.Update method. func (client *TagRulesClient) Update(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, properties TagRuleUpdate, options *TagRulesClientUpdateOptions) (TagRulesClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, properties, options) if err != nil { return TagRulesClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagRulesClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagRulesClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagRulesClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -368,10 +382,13 @@ func (client *TagRulesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client_example_test.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client_example_test.go deleted file mode 100644 index 1a37d738de87..000000000000 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/tagrules_client_example_test.go +++ /dev/null @@ -1,457 +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 armnewrelicobservability_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/newrelic/armnewrelicobservability" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MaximumSet_Gen.json -func ExampleTagRulesClient_NewListByNewRelicMonitorResourcePager_tagRulesListByNewRelicMonitorResourceMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTagRulesClient().NewListByNewRelicMonitorResourcePager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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.TagRuleListResult = armnewrelicobservability.TagRuleListResult{ - // Value: []*armnewrelicobservability.TagRule{ - // { - // Name: to.Ptr("ddoieozflu"), - // Type: to.Ptr("roafonrkfwwuv"), - // ID: to.Ptr("ycdsgeiitvxcd"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // CreatedBy: to.Ptr("wqrkemruqrvclsoevdftfeof"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // LastModifiedBy: to.Ptr("usdyoriebtakpdotcfp"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // LogRules: &armnewrelicobservability.LogRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armnewrelicobservability.MetricRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // UserEmail: to.Ptr("test@testing.com"), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_ListByNewRelicMonitorResource_MinimumSet_Gen.json -func ExampleTagRulesClient_NewListByNewRelicMonitorResourcePager_tagRulesListByNewRelicMonitorResourceMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTagRulesClient().NewListByNewRelicMonitorResourcePager("rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", 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.TagRuleListResult = armnewrelicobservability.TagRuleListResult{ - // Value: []*armnewrelicobservability.TagRule{ - // { - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MaximumSet_Gen.json -func ExampleTagRulesClient_Get_tagRulesGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Get(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", 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.TagRule = armnewrelicobservability.TagRule{ - // Name: to.Ptr("ddoieozflu"), - // Type: to.Ptr("roafonrkfwwuv"), - // ID: to.Ptr("ycdsgeiitvxcd"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // CreatedBy: to.Ptr("wqrkemruqrvclsoevdftfeof"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // LastModifiedBy: to.Ptr("usdyoriebtakpdotcfp"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // LogRules: &armnewrelicobservability.LogRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armnewrelicobservability.MetricRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // UserEmail: to.Ptr("test@testing.com"), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Get_MinimumSet_Gen.json -func ExampleTagRulesClient_Get_tagRulesGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Get(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", 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.TagRule = armnewrelicobservability.TagRule{ - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginCreateOrUpdate_tagRulesCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginCreateOrUpdate(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", armnewrelicobservability.TagRule{ - Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - LogRules: &armnewrelicobservability.LogRules{ - FilteringTags: []*armnewrelicobservability.FilteringTag{ - { - Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - Action: to.Ptr(armnewrelicobservability.TagActionInclude), - Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - }}, - SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armnewrelicobservability.MetricRules{ - FilteringTags: []*armnewrelicobservability.FilteringTag{ - { - Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - Action: to.Ptr(armnewrelicobservability.TagActionInclude), - Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - }}, - UserEmail: to.Ptr("test@testing.com"), - }, - ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateAccepted), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // 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.TagRule = armnewrelicobservability.TagRule{ - // Name: to.Ptr("ddoieozflu"), - // Type: to.Ptr("roafonrkfwwuv"), - // ID: to.Ptr("ycdsgeiitvxcd"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // CreatedBy: to.Ptr("wqrkemruqrvclsoevdftfeof"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // LastModifiedBy: to.Ptr("usdyoriebtakpdotcfp"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // LogRules: &armnewrelicobservability.LogRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armnewrelicobservability.MetricRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_CreateOrUpdate_MinimumSet_Gen.json -func ExampleTagRulesClient_BeginCreateOrUpdate_tagRulesCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginCreateOrUpdate(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", armnewrelicobservability.TagRule{ - Properties: &armnewrelicobservability.MonitoringTagRulesProperties{}, - }, 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.TagRule = armnewrelicobservability.TagRule{ - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MaximumSet_Gen.json -func ExampleTagRulesClient_BeginDelete_tagRulesDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginDelete(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Delete_MinimumSet_Gen.json -func ExampleTagRulesClient_BeginDelete_tagRulesDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTagRulesClient().BeginDelete(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", 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/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MaximumSet_Gen.json -func ExampleTagRulesClient_Update_tagRulesUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Update(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", armnewrelicobservability.TagRuleUpdate{ - Properties: &armnewrelicobservability.TagRuleUpdateProperties{ - LogRules: &armnewrelicobservability.LogRules{ - FilteringTags: []*armnewrelicobservability.FilteringTag{ - { - Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - Action: to.Ptr(armnewrelicobservability.TagActionInclude), - Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - }}, - SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - }, - MetricRules: &armnewrelicobservability.MetricRules{ - FilteringTags: []*armnewrelicobservability.FilteringTag{ - { - Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - Action: to.Ptr(armnewrelicobservability.TagActionInclude), - Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - }}, - UserEmail: to.Ptr("test@testing.com"), - }, - }, - }, 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.TagRule = armnewrelicobservability.TagRule{ - // Name: to.Ptr("ddoieozflu"), - // Type: to.Ptr("roafonrkfwwuv"), - // ID: to.Ptr("ycdsgeiitvxcd"), - // SystemData: &armnewrelicobservability.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // CreatedBy: to.Ptr("wqrkemruqrvclsoevdftfeof"), - // CreatedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-02T00:39:52.964Z"); return t}()), - // LastModifiedBy: to.Ptr("usdyoriebtakpdotcfp"), - // LastModifiedByType: to.Ptr(armnewrelicobservability.CreatedByTypeUser), - // }, - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // LogRules: &armnewrelicobservability.LogRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // SendAADLogs: to.Ptr(armnewrelicobservability.SendAADLogsStatusEnabled), - // SendActivityLogs: to.Ptr(armnewrelicobservability.SendActivityLogsStatusEnabled), - // SendSubscriptionLogs: to.Ptr(armnewrelicobservability.SendSubscriptionLogsStatusEnabled), - // }, - // MetricRules: &armnewrelicobservability.MetricRules{ - // FilteringTags: []*armnewrelicobservability.FilteringTag{ - // { - // Name: to.Ptr("saokgpjvdlorciqbjmjxazpee"), - // Action: to.Ptr(armnewrelicobservability.TagActionInclude), - // Value: to.Ptr("sarxrqsxouhdjwsrqqicbeirdb"), - // }}, - // UserEmail: to.Ptr("test@testing.com"), - // }, - // ProvisioningState: to.Ptr(armnewrelicobservability.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/newrelic/resource-manager/NewRelic.Observability/stable/2022-07-01/examples/TagRules_Update_MinimumSet_Gen.json -func ExampleTagRulesClient_Update_tagRulesUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnewrelicobservability.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTagRulesClient().Update(ctx, "rgopenapi", "ipxmlcbonyxtolzejcjshkmlron", "bxcantgzggsepbhqmedjqyrqeezmfb", armnewrelicobservability.TagRuleUpdate{}, 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.TagRule = armnewrelicobservability.TagRule{ - // ID: to.Ptr("ycdsgeiitvxcd"), - // Properties: &armnewrelicobservability.MonitoringTagRulesProperties{ - // }, - // } -} diff --git a/sdk/resourcemanager/newrelic/armnewrelicobservability/time_rfc3339.go b/sdk/resourcemanager/newrelic/armnewrelicobservability/time_rfc3339.go index 94ce9f539912..d04d66d04022 100644 --- a/sdk/resourcemanager/newrelic/armnewrelicobservability/time_rfc3339.go +++ b/sdk/resourcemanager/newrelic/armnewrelicobservability/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 armnewrelicobservability