From e69e456c73f2c912381b329c12baaf742b32f68d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 2 Feb 2023 04:41:24 +0000 Subject: [PATCH] CodeGen from PR 21670 in Azure/azure-rest-api-specs Merge 26c074053c91c913dcae1a9eea35ad4bddcbd230 into 3d7a3848106b831a4a7f46976fe38aa605c4f44d --- .../elastic/armelastic/CHANGELOG.md | 6 + .../armelastic/alltrafficfilters_client.go | 17 +- .../alltrafficfilters_client_example_test.go | 36 ----- .../associatetrafficfilter_client.go | 22 +-- ...ociatetrafficfilter_client_example_test.go | 39 ----- .../elastic/armelastic/autorest.md | 6 +- .../elastic/armelastic/constants.go | 2 +- .../createandassociateipfilter_client.go | 24 +-- ...ndassociateipfilter_client_example_test.go | 41 ----- .../createandassociateplfilter_client.go | 24 +-- ...ndassociateplfilter_client_example_test.go | 42 ----- .../armelastic/deploymentinfo_client.go | 17 +- .../deploymentinfo_client_example_test.go | 36 ----- .../detachanddeletetrafficfilter_client.go | 19 +-- ...deletetrafficfilter_client_example_test.go | 35 ----- .../armelastic/detachtrafficfilter_client.go | 22 +-- ...detachtrafficfilter_client_example_test.go | 39 ----- .../elastic/armelastic/externaluser_client.go | 19 +-- .../externaluser_client_example_test.go | 36 ----- sdk/resourcemanager/elastic/armelastic/go.mod | 14 +- sdk/resourcemanager/elastic/armelastic/go.sum | 21 +-- .../listassociatedtrafficfilters_client.go | 19 +-- ...iatedtrafficfilters_client_example_test.go | 36 ----- .../elastic/armelastic/models.go | 16 +- .../elastic/armelastic/models_serde.go | 76 ++++----- .../elastic/armelastic/monitor_client.go | 20 +-- .../armelastic/monitor_client_example_test.go | 38 ----- .../armelastic/monitoredresources_client.go | 18 ++- .../monitoredresources_client_example_test.go | 41 ----- .../elastic/armelastic/monitors_client.go | 74 +++++---- .../monitors_client_example_test.go | 147 ------------------ .../elastic/armelastic/operations_client.go | 11 +- .../operations_client_example_test.go | 41 ----- .../elastic/armelastic/response_types.go | 28 ++-- .../elastic/armelastic/tagrules_client.go | 59 +++---- .../tagrules_client_example_test.go | 100 ------------ .../elastic/armelastic/time_rfc3339.go | 2 +- .../armelastic/trafficfilters_client.go | 17 +- .../trafficfilters_client_example_test.go | 35 ----- .../armelastic/upgradableversions_client.go | 19 +-- .../upgradableversions_client_example_test.go | 36 ----- .../elastic/armelastic/vmcollection_client.go | 17 +- .../vmcollection_client_example_test.go | 34 ---- .../elastic/armelastic/vmhost_client.go | 17 +- .../armelastic/vmhost_client_example_test.go | 41 ----- .../elastic/armelastic/vmingestion_client.go | 17 +- .../vmingestion_client_example_test.go | 36 ----- 47 files changed, 325 insertions(+), 1187 deletions(-) delete mode 100644 sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go delete mode 100644 sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go diff --git a/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md b/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md index ce0f66ec5b11..2beaf7502a58 100644 --- a/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md +++ b/sdk/resourcemanager/elastic/armelastic/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 0.7.0 (2023-02-02) +### Features Added + +- New field `DeploymentURL` in struct `DeploymentInfoResponse` + + ## 0.6.0 (2022-11-10) ### Features Added diff --git a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go index 36587b1a2bed..dba8f4ff2b1f 100644 --- a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client.go @@ -40,9 +40,9 @@ type AllTrafficFiltersClient struct { } // NewAllTrafficFiltersClient creates a new instance of AllTrafficFiltersClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAllTrafficFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AllTrafficFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewAllTrafficFiltersClient(subscriptionID string, credential azcore.TokenCr // List - Get the list of all traffic filters for the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - AllTrafficFiltersClientListOptions contains the optional parameters for the AllTrafficFiltersClient.List method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - AllTrafficFiltersClientListOptions contains the optional parameters for the AllTrafficFiltersClient.List method. func (client *AllTrafficFiltersClient) List(ctx context.Context, resourceGroupName string, monitorName string, options *AllTrafficFiltersClientListOptions) (AllTrafficFiltersClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *AllTrafficFiltersClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go deleted file mode 100644 index beeaccb7cc21..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/alltrafficfilters_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AllTrafficFilters_list.json -func ExampleAllTrafficFiltersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewAllTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go index 8faf175a506e..4b5c058d0009 100644 --- a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client.go @@ -40,9 +40,9 @@ type AssociateTrafficFilterClient struct { } // NewAssociateTrafficFilterClient creates a new instance of AssociateTrafficFilterClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssociateTrafficFilterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssociateTrafficFilterClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewAssociateTrafficFilterClient(subscriptionID string, credential azcore.To // BeginAssociate - Associate traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - AssociateTrafficFilterClientBeginAssociateOptions contains the optional parameters for the AssociateTrafficFilterClient.BeginAssociate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - AssociateTrafficFilterClientBeginAssociateOptions contains the optional parameters for the AssociateTrafficFilterClient.BeginAssociate +// method. func (client *AssociateTrafficFilterClient) BeginAssociate(ctx context.Context, resourceGroupName string, monitorName string, options *AssociateTrafficFilterClientBeginAssociateOptions) (*runtime.Poller[AssociateTrafficFilterClientAssociateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.associate(ctx, resourceGroupName, monitorName, options) @@ -84,7 +85,8 @@ func (client *AssociateTrafficFilterClient) BeginAssociate(ctx context.Context, // Associate - Associate traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *AssociateTrafficFilterClient) associate(ctx context.Context, resourceGroupName string, monitorName string, options *AssociateTrafficFilterClientBeginAssociateOptions) (*http.Response, error) { req, err := client.associateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -120,7 +122,7 @@ func (client *AssociateTrafficFilterClient) associateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go deleted file mode 100644 index edecd73f62b1..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/associatetrafficfilter_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AssociateTrafficFilter_Update.json -func ExampleAssociateTrafficFilterClient_BeginAssociate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewAssociateTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAssociate(ctx, "myResourceGroup", "myMonitor", &armelastic.AssociateTrafficFilterClientBeginAssociateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/autorest.md b/sdk/resourcemanager/elastic/armelastic/autorest.md index 603c2442d9d4..fd1f81202710 100644 --- a/sdk/resourcemanager/elastic/armelastic/autorest.md +++ b/sdk/resourcemanager/elastic/armelastic/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/232b858812a4f946a82bc11a81241826f5554fbd/specification/elastic/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/232b858812a4f946a82bc11a81241826f5554fbd/specification/elastic/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/elastic/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/elastic/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.0 +module-version: 0.7.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/elastic/armelastic/constants.go b/sdk/resourcemanager/elastic/armelastic/constants.go index 8eb77ac1802a..891c59588546 100644 --- a/sdk/resourcemanager/elastic/armelastic/constants.go +++ b/sdk/resourcemanager/elastic/armelastic/constants.go @@ -19,7 +19,7 @@ package armelastic const ( moduleName = "armelastic" - moduleVersion = "v0.6.0" + moduleVersion = "v0.7.0" ) // CreatedByType - The type of identity that created the resource. diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go index 91540e714e30..2a5b223b20aa 100644 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client.go @@ -40,9 +40,9 @@ type CreateAndAssociateIPFilterClient struct { } // NewCreateAndAssociateIPFilterClient creates a new instance of CreateAndAssociateIPFilterClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCreateAndAssociateIPFilterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CreateAndAssociateIPFilterClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewCreateAndAssociateIPFilterClient(subscriptionID string, credential azcor // BeginCreate - Create and Associate IP traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - CreateAndAssociateIPFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociateIPFilterClient.BeginCreate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - CreateAndAssociateIPFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociateIPFilterClient.BeginCreate +// method. func (client *CreateAndAssociateIPFilterClient) BeginCreate(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociateIPFilterClientBeginCreateOptions) (*runtime.Poller[CreateAndAssociateIPFilterClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, monitorName, options) @@ -84,7 +85,8 @@ func (client *CreateAndAssociateIPFilterClient) BeginCreate(ctx context.Context, // Create - Create and Associate IP traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *CreateAndAssociateIPFilterClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociateIPFilterClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -94,7 +96,7 @@ func (client *CreateAndAssociateIPFilterClient) create(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -120,7 +122,7 @@ func (client *CreateAndAssociateIPFilterClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.IPs != nil { reqQP.Set("ips", *options.IPs) } diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go deleted file mode 100644 index 788b0cc85e26..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateipfilter_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/IPTrafficFilter_Create.json -func ExampleCreateAndAssociateIPFilterClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewCreateAndAssociateIPFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociateIPFilterClientBeginCreateOptions{IPs: to.Ptr("192.168.131.0, 192.168.132.6/22"), - Name: 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go index 41621a95a63c..6a99cfd53aef 100644 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client.go @@ -40,9 +40,9 @@ type CreateAndAssociatePLFilterClient struct { } // NewCreateAndAssociatePLFilterClient creates a new instance of CreateAndAssociatePLFilterClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCreateAndAssociatePLFilterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CreateAndAssociatePLFilterClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewCreateAndAssociatePLFilterClient(subscriptionID string, credential azcor // BeginCreate - Create and Associate private link traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - CreateAndAssociatePLFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociatePLFilterClient.BeginCreate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - CreateAndAssociatePLFilterClientBeginCreateOptions contains the optional parameters for the CreateAndAssociatePLFilterClient.BeginCreate +// method. func (client *CreateAndAssociatePLFilterClient) BeginCreate(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociatePLFilterClientBeginCreateOptions) (*runtime.Poller[CreateAndAssociatePLFilterClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, monitorName, options) @@ -84,7 +85,8 @@ func (client *CreateAndAssociatePLFilterClient) BeginCreate(ctx context.Context, // Create - Create and Associate private link traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *CreateAndAssociatePLFilterClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *CreateAndAssociatePLFilterClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -94,7 +96,7 @@ func (client *CreateAndAssociatePLFilterClient) create(ctx context.Context, reso if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -120,7 +122,7 @@ func (client *CreateAndAssociatePLFilterClient) createCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.Name != nil { reqQP.Set("name", *options.Name) } diff --git a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go deleted file mode 100644 index a5924bc02c04..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/createandassociateplfilter_client_example_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/PrivateLinkTrafficFilters_Create.json -func ExampleCreateAndAssociatePLFilterClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewCreateAndAssociatePLFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociatePLFilterClientBeginCreateOptions{Name: nil, - PrivateEndpointGUID: to.Ptr("fdb54d3b-e85e-4d08-8958-0d2f7g523df9"), - PrivateEndpointName: to.Ptr("myPrivateEndpoint"), - }) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go index 863b871ce7ec..4f41cebdebc6 100644 --- a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go +++ b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client.go @@ -40,9 +40,9 @@ type DeploymentInfoClient struct { } // NewDeploymentInfoClient creates a new instance of DeploymentInfoClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeploymentInfoClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentInfoClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewDeploymentInfoClient(subscriptionID string, credential azcore.TokenCrede // List - Fetch information regarding Elastic cloud deployment corresponding to the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - DeploymentInfoClientListOptions contains the optional parameters for the DeploymentInfoClient.List method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - DeploymentInfoClientListOptions contains the optional parameters for the DeploymentInfoClient.List method. func (client *DeploymentInfoClient) List(ctx context.Context, resourceGroupName string, monitorName string, options *DeploymentInfoClientListOptions) (DeploymentInfoClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *DeploymentInfoClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go deleted file mode 100644 index 45f09dd244a3..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/deploymentinfo_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DeploymentInfo_List.json -func ExampleDeploymentInfoClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDeploymentInfoClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go index 580fdfabe04c..ae2255247b77 100644 --- a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client.go @@ -40,9 +40,9 @@ type DetachAndDeleteTrafficFilterClient struct { } // NewDetachAndDeleteTrafficFilterClient creates a new instance of DetachAndDeleteTrafficFilterClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDetachAndDeleteTrafficFilterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DetachAndDeleteTrafficFilterClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewDetachAndDeleteTrafficFilterClient(subscriptionID string, credential azc // Delete - Detach and Delete traffic filter from the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - DetachAndDeleteTrafficFilterClientDeleteOptions contains the optional parameters for the DetachAndDeleteTrafficFilterClient.Delete -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - DetachAndDeleteTrafficFilterClientDeleteOptions contains the optional parameters for the DetachAndDeleteTrafficFilterClient.Delete +// method. func (client *DetachAndDeleteTrafficFilterClient) Delete(ctx context.Context, resourceGroupName string, monitorName string, options *DetachAndDeleteTrafficFilterClientDeleteOptions) (DetachAndDeleteTrafficFilterClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -105,7 +106,7 @@ func (client *DetachAndDeleteTrafficFilterClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go deleted file mode 100644 index 34ee8a29afc6..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/detachanddeletetrafficfilter_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DetachAndDeleteTrafficFilter_Delete.json -func ExampleDetachAndDeleteTrafficFilterClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDetachAndDeleteTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachAndDeleteTrafficFilterClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go index f5b6d2b96871..01f437e5f6f9 100644 --- a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go +++ b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client.go @@ -40,9 +40,9 @@ type DetachTrafficFilterClient struct { } // NewDetachTrafficFilterClient creates a new instance of DetachTrafficFilterClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDetachTrafficFilterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DetachTrafficFilterClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewDetachTrafficFilterClient(subscriptionID string, credential azcore.Token // BeginUpdate - Detach traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - DetachTrafficFilterClientBeginUpdateOptions contains the optional parameters for the DetachTrafficFilterClient.BeginUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - DetachTrafficFilterClientBeginUpdateOptions contains the optional parameters for the DetachTrafficFilterClient.BeginUpdate +// method. func (client *DetachTrafficFilterClient) BeginUpdate(ctx context.Context, resourceGroupName string, monitorName string, options *DetachTrafficFilterClientBeginUpdateOptions) (*runtime.Poller[DetachTrafficFilterClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, monitorName, options) @@ -84,7 +85,8 @@ func (client *DetachTrafficFilterClient) BeginUpdate(ctx context.Context, resour // Update - Detach traffic filter for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *DetachTrafficFilterClient) update(ctx context.Context, resourceGroupName string, monitorName string, options *DetachTrafficFilterClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -120,7 +122,7 @@ func (client *DetachTrafficFilterClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go deleted file mode 100644 index 2c92ee42faa2..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/detachtrafficfilter_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/DetachTrafficFilters_Update.json -func ExampleDetachTrafficFilterClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewDetachTrafficFilterClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachTrafficFilterClientBeginUpdateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/externaluser_client.go b/sdk/resourcemanager/elastic/armelastic/externaluser_client.go index d04280112650..595033d913f2 100644 --- a/sdk/resourcemanager/elastic/armelastic/externaluser_client.go +++ b/sdk/resourcemanager/elastic/armelastic/externaluser_client.go @@ -40,9 +40,9 @@ type ExternalUserClient struct { } // NewExternalUserClient creates a new instance of ExternalUserClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExternalUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExternalUserClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -66,11 +66,12 @@ func NewExternalUserClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create User inside elastic deployment which are used by customers to perform operations on the elastic // deployment // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - ExternalUserClientCreateOrUpdateOptions contains the optional parameters for the ExternalUserClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - ExternalUserClientCreateOrUpdateOptions contains the optional parameters for the ExternalUserClient.CreateOrUpdate +// method. func (client *ExternalUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, options *ExternalUserClientCreateOrUpdateOptions) (ExternalUserClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -106,7 +107,7 @@ func (client *ExternalUserClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go deleted file mode 100644 index 5f8910d9592f..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/externaluser_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/ExternalUserInfo.json -func ExampleExternalUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewExternalUserClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.ExternalUserClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/go.mod b/sdk/resourcemanager/elastic/armelastic/go.mod index 860dc4999af5..625e7e37a024 100644 --- a/sdk/resourcemanager/elastic/armelastic/go.mod +++ b/sdk/resourcemanager/elastic/armelastic/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/elastic/armelastic/go.sum b/sdk/resourcemanager/elastic/armelastic/go.sum index 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/elastic/armelastic/go.sum +++ b/sdk/resourcemanager/elastic/armelastic/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go index 869134347ff8..4d093bc6eadd 100644 --- a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client.go @@ -40,9 +40,9 @@ type ListAssociatedTrafficFiltersClient struct { } // NewListAssociatedTrafficFiltersClient creates a new instance of ListAssociatedTrafficFiltersClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewListAssociatedTrafficFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ListAssociatedTrafficFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewListAssociatedTrafficFiltersClient(subscriptionID string, credential azc // List - Get the list of all associated traffic filters for the given deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - ListAssociatedTrafficFiltersClientListOptions contains the optional parameters for the ListAssociatedTrafficFiltersClient.List -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - ListAssociatedTrafficFiltersClientListOptions contains the optional parameters for the ListAssociatedTrafficFiltersClient.List +// method. func (client *ListAssociatedTrafficFiltersClient) List(ctx context.Context, resourceGroupName string, monitorName string, options *ListAssociatedTrafficFiltersClientListOptions) (ListAssociatedTrafficFiltersClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -105,7 +106,7 @@ func (client *ListAssociatedTrafficFiltersClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go deleted file mode 100644 index 4a08035bf1f3..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/listassociatedtrafficfilters_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/AssociatedFiltersForDeployment_list.json -func ExampleListAssociatedTrafficFiltersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewListAssociatedTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/models.go b/sdk/resourcemanager/elastic/armelastic/models.go index 4ef97417c273..0b24b2ace8d8 100644 --- a/sdk/resourcemanager/elastic/armelastic/models.go +++ b/sdk/resourcemanager/elastic/armelastic/models.go @@ -118,6 +118,9 @@ type DeploymentInfoClientListOptions struct { // DeploymentInfoResponse - The properties of deployment in Elastic cloud corresponding to the Elastic monitor resource. type DeploymentInfoResponse struct { + // READ-ONLY; Deployment URL of the elasticsearch in Elastic cloud deployment. + DeploymentURL *string `json:"deploymentUrl,omitempty" azure:"ro"` + // READ-ONLY; Disk capacity of the elasticsearch in Elastic cloud deployment. DiskCapacity *string `json:"diskCapacity,omitempty" azure:"ro"` @@ -330,7 +333,7 @@ type MonitoredResourceListResponse struct { Value []*MonitoredResource `json:"value,omitempty"` } -// MonitoredResourcesClientListOptions contains the optional parameters for the MonitoredResourcesClient.List method. +// MonitoredResourcesClientListOptions contains the optional parameters for the MonitoredResourcesClient.NewListPager method. type MonitoredResourcesClientListOptions struct { // placeholder for future optional parameters } @@ -390,12 +393,13 @@ type MonitorsClientGetOptions struct { // placeholder for future optional parameters } -// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup method. +// MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. type MonitorsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. +// MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. type MonitorsClientListOptions struct { // placeholder for future optional parameters } @@ -445,7 +449,7 @@ type OperationResult struct { Origin *string `json:"origin,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -503,7 +507,7 @@ type TagRulesClientGetOptions struct { // placeholder for future optional parameters } -// TagRulesClientListOptions contains the optional parameters for the TagRulesClient.List method. +// TagRulesClientListOptions contains the optional parameters for the TagRulesClient.NewListPager method. type TagRulesClientListOptions struct { // placeholder for future optional parameters } @@ -609,7 +613,7 @@ type VMCollectionUpdate struct { VMResourceID *string `json:"vmResourceId,omitempty"` } -// VMHostClientListOptions contains the optional parameters for the VMHostClient.List method. +// VMHostClientListOptions contains the optional parameters for the VMHostClient.NewListPager method. type VMHostClientListOptions struct { // placeholder for future optional parameters } diff --git a/sdk/resourcemanager/elastic/armelastic/models_serde.go b/sdk/resourcemanager/elastic/armelastic/models_serde.go index 8385411b1eb0..a9b728ab2bbd 100644 --- a/sdk/resourcemanager/elastic/armelastic/models_serde.go +++ b/sdk/resourcemanager/elastic/armelastic/models_serde.go @@ -26,7 +26,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type CloudDeployment. func (c CloudDeployment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureSubscriptionId", c.AzureSubscriptionID) populate(objectMap, "deploymentId", c.DeploymentID) populate(objectMap, "elasticsearchRegion", c.ElasticsearchRegion) @@ -77,7 +77,7 @@ func (c *CloudDeployment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CloudUser. func (c CloudUser) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "elasticCloudSsoDefaultUrl", c.ElasticCloudSsoDefaultURL) populate(objectMap, "emailAddress", c.EmailAddress) populate(objectMap, "id", c.ID) @@ -112,7 +112,7 @@ func (c *CloudUser) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CompanyInfo. func (c CompanyInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "business", c.Business) populate(objectMap, "country", c.Country) populate(objectMap, "domain", c.Domain) @@ -155,7 +155,8 @@ func (c *CompanyInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeploymentInfoResponse. func (d DeploymentInfoResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populate(objectMap, "deploymentUrl", d.DeploymentURL) populate(objectMap, "diskCapacity", d.DiskCapacity) populate(objectMap, "memoryCapacity", d.MemoryCapacity) populate(objectMap, "status", d.Status) @@ -172,6 +173,9 @@ func (d *DeploymentInfoResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "deploymentUrl": + err = unpopulate(val, "DeploymentURL", &d.DeploymentURL) + delete(rawMsg, key) case "diskCapacity": err = unpopulate(val, "DiskCapacity", &d.DiskCapacity) delete(rawMsg, key) @@ -194,7 +198,7 @@ func (d *DeploymentInfoResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExternalUserCreationResponse. func (e ExternalUserCreationResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "created", e.Created) return json.Marshal(objectMap) } @@ -221,7 +225,7 @@ func (e *ExternalUserCreationResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExternalUserInfo. func (e ExternalUserInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "emailId", e.EmailID) populate(objectMap, "fullName", e.FullName) populate(objectMap, "password", e.Password) @@ -264,7 +268,7 @@ func (e *ExternalUserInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FilteringTag. func (f FilteringTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "action", f.Action) populate(objectMap, "name", f.Name) populate(objectMap, "value", f.Value) @@ -299,7 +303,7 @@ func (f *FilteringTag) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentityProperties. func (i IdentityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) @@ -334,7 +338,7 @@ func (i *IdentityProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LogRules. func (l LogRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "filteringTags", l.FilteringTags) populate(objectMap, "sendAadLogs", l.SendAADLogs) populate(objectMap, "sendActivityLogs", l.SendActivityLogs) @@ -373,7 +377,7 @@ func (l *LogRules) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorProperties. func (m MonitorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "elasticProperties", m.ElasticProperties) populate(objectMap, "liftrResourceCategory", m.LiftrResourceCategory) populate(objectMap, "liftrResourcePreference", m.LiftrResourcePreference) @@ -424,7 +428,7 @@ func (m *MonitorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorResource. func (m MonitorResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) @@ -483,7 +487,7 @@ func (m *MonitorResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorResourceListResponse. func (m MonitorResourceListResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -514,7 +518,7 @@ func (m *MonitorResourceListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorResourceUpdateParameters. func (m MonitorResourceUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) } @@ -541,7 +545,7 @@ func (m *MonitorResourceUpdateParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitorUpgrade. func (m MonitorUpgrade) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "version", m.Version) return json.Marshal(objectMap) } @@ -568,7 +572,7 @@ func (m *MonitorUpgrade) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoredResource. func (m MonitoredResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "reasonForLogsStatus", m.ReasonForLogsStatus) populate(objectMap, "sendingLogs", m.SendingLogs) @@ -603,7 +607,7 @@ func (m *MonitoredResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoredResourceListResponse. func (m MonitoredResourceListResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -634,7 +638,7 @@ func (m *MonitoredResourceListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringTagRules. func (m MonitoringTagRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -677,7 +681,7 @@ func (m *MonitoringTagRules) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringTagRulesListResponse. func (m MonitoringTagRulesListResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -708,7 +712,7 @@ func (m *MonitoringTagRulesListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MonitoringTagRulesProperties. func (m MonitoringTagRulesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "logRules", m.LogRules) populate(objectMap, "provisioningState", m.ProvisioningState) return json.Marshal(objectMap) @@ -739,7 +743,7 @@ func (m *MonitoringTagRulesProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -778,7 +782,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationListResult. func (o OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -809,7 +813,7 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationResult. func (o OperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) @@ -848,7 +852,7 @@ func (o *OperationResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Properties. func (p Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "elasticCloudDeployment", p.ElasticCloudDeployment) populate(objectMap, "elasticCloudUser", p.ElasticCloudUser) return json.Marshal(objectMap) @@ -879,7 +883,7 @@ func (p *Properties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceSKU. func (r ResourceSKU) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } @@ -906,7 +910,7 @@ func (r *ResourceSKU) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -953,7 +957,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrafficFilter. func (t TrafficFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", t.Description) populate(objectMap, "id", t.ID) populate(objectMap, "includeByDefault", t.IncludeByDefault) @@ -1004,7 +1008,7 @@ func (t *TrafficFilter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrafficFilterResponse. func (t TrafficFilterResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "rulesets", t.Rulesets) return json.Marshal(objectMap) } @@ -1031,7 +1035,7 @@ func (t *TrafficFilterResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrafficFilterRule. func (t TrafficFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureEndpointGuid", t.AzureEndpointGUID) populate(objectMap, "azureEndpointName", t.AzureEndpointName) populate(objectMap, "description", t.Description) @@ -1074,7 +1078,7 @@ func (t *TrafficFilterRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpgradableVersionsList. func (u UpgradableVersionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "currentVersion", u.CurrentVersion) populate(objectMap, "upgradableVersions", u.UpgradableVersions) return json.Marshal(objectMap) @@ -1105,7 +1109,7 @@ func (u *UpgradableVersionsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserInfo. func (u UserInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "companyInfo", u.CompanyInfo) populate(objectMap, "companyName", u.CompanyName) populate(objectMap, "emailAddress", u.EmailAddress) @@ -1148,7 +1152,7 @@ func (u *UserInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMCollectionUpdate. func (v VMCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operationName", v.OperationName) populate(objectMap, "vmResourceId", v.VMResourceID) return json.Marshal(objectMap) @@ -1179,7 +1183,7 @@ func (v *VMCollectionUpdate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMHostListResponse. func (v VMHostListResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", v.NextLink) populate(objectMap, "value", v.Value) return json.Marshal(objectMap) @@ -1210,7 +1214,7 @@ func (v *VMHostListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMIngestionDetailsResponse. func (v VMIngestionDetailsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudId", v.CloudID) populate(objectMap, "ingestionKey", v.IngestionKey) return json.Marshal(objectMap) @@ -1241,7 +1245,7 @@ func (v *VMIngestionDetailsResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMResources. func (v VMResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "vmResourceId", v.VMResourceID) return json.Marshal(objectMap) } @@ -1266,7 +1270,7 @@ func (v *VMResources) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -1276,7 +1280,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/elastic/armelastic/monitor_client.go b/sdk/resourcemanager/elastic/armelastic/monitor_client.go index 01b9dbf28896..ebb8d4910c49 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitor_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitor_client.go @@ -40,9 +40,9 @@ type MonitorClient struct { } // NewMonitorClient creates a new instance of MonitorClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMonitorClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitorClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewMonitorClient(subscriptionID string, credential azcore.TokenCredential, // BeginUpgrade - Upgradable version for a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitorClientBeginUpgradeOptions contains the optional parameters for the MonitorClient.BeginUpgrade method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitorClientBeginUpgradeOptions contains the optional parameters for the MonitorClient.BeginUpgrade method. func (client *MonitorClient) BeginUpgrade(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorClientBeginUpgradeOptions) (*runtime.Poller[MonitorClientUpgradeResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.upgrade(ctx, resourceGroupName, monitorName, options) @@ -83,7 +84,8 @@ func (client *MonitorClient) BeginUpgrade(ctx context.Context, resourceGroupName // Upgrade - Upgradable version for a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *MonitorClient) upgrade(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorClientBeginUpgradeOptions) (*http.Response, error) { req, err := client.upgradeCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -119,7 +121,7 @@ func (client *MonitorClient) upgradeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go deleted file mode 100644 index 8873cb24c165..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitor_client_example_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitor_Upgrade.json -func ExampleMonitorClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpgrade(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorClientBeginUpgradeOptions{Body: 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) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go index de5ac0575378..289dc5b3f298 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client.go @@ -40,9 +40,9 @@ type MonitoredResourcesClient struct { } // NewMonitoredResourcesClient creates a new instance of MonitoredResourcesClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMonitoredResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitoredResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -64,10 +64,12 @@ func NewMonitoredResourcesClient(subscriptionID string, credential azcore.TokenC } // NewListPager - List the resources currently being monitored by the Elastic monitor resource. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitoredResourcesClientListOptions contains the optional parameters for the MonitoredResourcesClient.List method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitoredResourcesClientListOptions contains the optional parameters for the MonitoredResourcesClient.NewListPager +// method. func (client *MonitoredResourcesClient) NewListPager(resourceGroupName string, monitorName string, options *MonitoredResourcesClientListOptions) *runtime.Pager[MonitoredResourcesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitoredResourcesClientListResponse]{ More: func(page MonitoredResourcesClientListResponse) bool { @@ -116,7 +118,7 @@ func (client *MonitoredResourcesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go deleted file mode 100644 index d517d2b1a470..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitoredresources_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/MonitoredResources_List.json -func ExampleMonitoredResourcesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitoredResourcesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/monitors_client.go b/sdk/resourcemanager/elastic/armelastic/monitors_client.go index 10c91254f3e3..0842434f014e 100644 --- a/sdk/resourcemanager/elastic/armelastic/monitors_client.go +++ b/sdk/resourcemanager/elastic/armelastic/monitors_client.go @@ -40,9 +40,9 @@ type MonitorsClient struct { } // NewMonitorsClient creates a new instance of MonitorsClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MonitorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitorsClientBeginCreateOptions contains the optional parameters for the MonitorsClient.BeginCreate method. func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginCreateOptions) (*runtime.Poller[MonitorsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, monitorName, options) @@ -85,7 +86,8 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Create a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -121,7 +123,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -132,10 +134,11 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*runtime.Poller[MonitorsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, monitorName, options) @@ -150,7 +153,8 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -186,7 +190,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,10 +198,11 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the properties of a specific monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. func (client *MonitorsClient) Get(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientGetOptions) (MonitorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -233,7 +238,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,8 +254,9 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl } // NewListPager - List all monitors under the specified subscription. -// Generated from API version 2022-07-01-preview -// options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. +// +// Generated from API version 2022-09-01-preview +// - options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListResponse]{ More: func(page MonitorsClientListResponse) bool { @@ -291,7 +297,7 @@ func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *Mo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,10 +313,11 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC } // NewListByResourceGroupPager - List all monitors under the specified resource group. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager +// method. func (client *MonitorsClient) NewListByResourceGroupPager(resourceGroupName string, options *MonitorsClientListByResourceGroupOptions) *runtime.Pager[MonitorsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListByResourceGroupResponse]{ More: func(page MonitorsClientListByResourceGroupResponse) bool { @@ -355,7 +362,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,10 +379,11 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // Update - Update a monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - MonitorsClientUpdateOptions contains the optional parameters for the MonitorsClient.Update method. func (client *MonitorsClient) Update(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientUpdateOptions) (MonitorsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -411,7 +419,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go deleted file mode 100644 index 1cb2be29ae11..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/monitors_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_List.json -func ExampleMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_ListByResourceGroup.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Get.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Create.json -func ExampleMonitorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientBeginCreateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Update.json -func ExampleMonitorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Monitors_Delete.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/operations_client.go b/sdk/resourcemanager/elastic/armelastic/operations_client.go index be3f5e8cd80a..68ab92ca2c29 100644 --- a/sdk/resourcemanager/elastic/armelastic/operations_client.go +++ b/sdk/resourcemanager/elastic/armelastic/operations_client.go @@ -36,8 +36,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,8 +58,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - List all operations provided by Microsoft.Elastic. -// Generated from API version 2022-07-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-09-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]{ More: func(page OperationsClientListResponse) bool { @@ -96,7 +97,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go deleted file mode 100644 index 042f74a3063a..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/response_types.go b/sdk/resourcemanager/elastic/armelastic/response_types.go index 9bafdd026e51..f759805c35f6 100644 --- a/sdk/resourcemanager/elastic/armelastic/response_types.go +++ b/sdk/resourcemanager/elastic/armelastic/response_types.go @@ -22,17 +22,17 @@ type AllTrafficFiltersClientListResponse struct { TrafficFilterResponse } -// AssociateTrafficFilterClientAssociateResponse contains the response from method AssociateTrafficFilterClient.Associate. +// AssociateTrafficFilterClientAssociateResponse contains the response from method AssociateTrafficFilterClient.BeginAssociate. type AssociateTrafficFilterClientAssociateResponse struct { // placeholder for future response values } -// CreateAndAssociateIPFilterClientCreateResponse contains the response from method CreateAndAssociateIPFilterClient.Create. +// CreateAndAssociateIPFilterClientCreateResponse contains the response from method CreateAndAssociateIPFilterClient.BeginCreate. type CreateAndAssociateIPFilterClientCreateResponse struct { // placeholder for future response values } -// CreateAndAssociatePLFilterClientCreateResponse contains the response from method CreateAndAssociatePLFilterClient.Create. +// CreateAndAssociatePLFilterClientCreateResponse contains the response from method CreateAndAssociatePLFilterClient.BeginCreate. type CreateAndAssociatePLFilterClientCreateResponse struct { // placeholder for future response values } @@ -47,7 +47,7 @@ type DetachAndDeleteTrafficFilterClientDeleteResponse struct { // placeholder for future response values } -// DetachTrafficFilterClientUpdateResponse contains the response from method DetachTrafficFilterClient.Update. +// DetachTrafficFilterClientUpdateResponse contains the response from method DetachTrafficFilterClient.BeginUpdate. type DetachTrafficFilterClientUpdateResponse struct { // placeholder for future response values } @@ -62,22 +62,22 @@ type ListAssociatedTrafficFiltersClientListResponse struct { TrafficFilterResponse } -// MonitorClientUpgradeResponse contains the response from method MonitorClient.Upgrade. +// MonitorClientUpgradeResponse contains the response from method MonitorClient.BeginUpgrade. type MonitorClientUpgradeResponse struct { // placeholder for future response values } -// MonitoredResourcesClientListResponse contains the response from method MonitoredResourcesClient.List. +// MonitoredResourcesClientListResponse contains the response from method MonitoredResourcesClient.NewListPager. type MonitoredResourcesClientListResponse struct { MonitoredResourceListResponse } -// MonitorsClientCreateResponse contains the response from method MonitorsClient.Create. +// MonitorsClientCreateResponse contains the response from method MonitorsClient.BeginCreate. type MonitorsClientCreateResponse struct { MonitorResource } -// MonitorsClientDeleteResponse contains the response from method MonitorsClient.Delete. +// MonitorsClientDeleteResponse contains the response from method MonitorsClient.BeginDelete. type MonitorsClientDeleteResponse struct { // placeholder for future response values } @@ -87,12 +87,12 @@ type MonitorsClientGetResponse struct { MonitorResource } -// MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.ListByResourceGroup. +// MonitorsClientListByResourceGroupResponse contains the response from method MonitorsClient.NewListByResourceGroupPager. type MonitorsClientListByResourceGroupResponse struct { MonitorResourceListResponse } -// MonitorsClientListResponse contains the response from method MonitorsClient.List. +// MonitorsClientListResponse contains the response from method MonitorsClient.NewListPager. type MonitorsClientListResponse struct { MonitorResourceListResponse } @@ -102,7 +102,7 @@ type MonitorsClientUpdateResponse struct { MonitorResource } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } @@ -112,7 +112,7 @@ type TagRulesClientCreateOrUpdateResponse struct { MonitoringTagRules } -// TagRulesClientDeleteResponse contains the response from method TagRulesClient.Delete. +// TagRulesClientDeleteResponse contains the response from method TagRulesClient.BeginDelete. type TagRulesClientDeleteResponse struct { // placeholder for future response values } @@ -122,7 +122,7 @@ type TagRulesClientGetResponse struct { MonitoringTagRules } -// TagRulesClientListResponse contains the response from method TagRulesClient.List. +// TagRulesClientListResponse contains the response from method TagRulesClient.NewListPager. type TagRulesClientListResponse struct { MonitoringTagRulesListResponse } @@ -142,7 +142,7 @@ type VMCollectionClientUpdateResponse struct { // placeholder for future response values } -// VMHostClientListResponse contains the response from method VMHostClient.List. +// VMHostClientListResponse contains the response from method VMHostClient.NewListPager. type VMHostClientListResponse struct { VMHostListResponse } diff --git a/sdk/resourcemanager/elastic/armelastic/tagrules_client.go b/sdk/resourcemanager/elastic/armelastic/tagrules_client.go index 33ec9c128a81..b4ace31436fd 100644 --- a/sdk/resourcemanager/elastic/armelastic/tagrules_client.go +++ b/sdk/resourcemanager/elastic/armelastic/tagrules_client.go @@ -40,9 +40,9 @@ type TagRulesClient struct { } // NewTagRulesClient creates a new instance of TagRulesClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewTagRulesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Create or update a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// ruleSetName - Tag Rule Set resource name -// options - TagRulesClientCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.CreateOrUpdate method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - ruleSetName - Tag Rule Set resource name +// - options - TagRulesClientCreateOrUpdateOptions contains the optional parameters for the TagRulesClient.CreateOrUpdate method. func (client *TagRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientCreateOrUpdateOptions) (TagRulesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -109,7 +110,7 @@ func (client *TagRulesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -129,11 +130,12 @@ func (client *TagRulesClient) createOrUpdateHandleResponse(resp *http.Response) // BeginDelete - Delete a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// ruleSetName - Tag Rule Set resource name -// options - TagRulesClientBeginDeleteOptions contains the optional parameters for the TagRulesClient.BeginDelete method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - ruleSetName - Tag Rule Set resource name +// - options - TagRulesClientBeginDeleteOptions contains the optional parameters for the TagRulesClient.BeginDelete method. func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*runtime.Poller[TagRulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, monitorName, ruleSetName, options) @@ -148,7 +150,8 @@ func (client *TagRulesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview +// +// Generated from API version 2022-09-01-preview func (client *TagRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -188,7 +191,7 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,11 +199,12 @@ func (client *TagRulesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a tag rule set for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// ruleSetName - Tag Rule Set resource name -// options - TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - ruleSetName - Tag Rule Set resource name +// - options - TagRulesClientGetOptions contains the optional parameters for the TagRulesClient.Get method. func (client *TagRulesClient) Get(ctx context.Context, resourceGroupName string, monitorName string, ruleSetName string, options *TagRulesClientGetOptions) (TagRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, monitorName, ruleSetName, options) if err != nil { @@ -240,7 +244,7 @@ func (client *TagRulesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,10 +260,11 @@ func (client *TagRulesClient) getHandleResponse(resp *http.Response) (TagRulesCl } // NewListPager - List the tag rules for a given monitor resource. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - TagRulesClientListOptions contains the optional parameters for the TagRulesClient.List method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - TagRulesClientListOptions contains the optional parameters for the TagRulesClient.NewListPager method. func (client *TagRulesClient) NewListPager(resourceGroupName string, monitorName string, options *TagRulesClientListOptions) *runtime.Pager[TagRulesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TagRulesClientListResponse]{ More: func(page TagRulesClientListResponse) bool { @@ -308,7 +313,7 @@ func (client *TagRulesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go deleted file mode 100644 index 2c3a9aa87425..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/tagrules_client_example_test.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_List.json -func ExampleTagRulesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_CreateOrUpdate.json -func ExampleTagRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armelastic.TagRulesClientCreateOrUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_Get.json -func ExampleTagRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TagRules_Delete.json -func ExampleTagRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTagRulesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "myMonitor", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/time_rfc3339.go b/sdk/resourcemanager/elastic/armelastic/time_rfc3339.go index 90e750315192..f95524655b97 100644 --- a/sdk/resourcemanager/elastic/armelastic/time_rfc3339.go +++ b/sdk/resourcemanager/elastic/armelastic/time_rfc3339.go @@ -70,7 +70,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go index 9e985e23b41a..41bf030135a6 100644 --- a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go +++ b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client.go @@ -40,9 +40,9 @@ type TrafficFiltersClient struct { } // NewTrafficFiltersClient creates a new instance of TrafficFiltersClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTrafficFiltersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TrafficFiltersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewTrafficFiltersClient(subscriptionID string, credential azcore.TokenCrede // Delete - Delete traffic filter from the account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - TrafficFiltersClientDeleteOptions contains the optional parameters for the TrafficFiltersClient.Delete method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - TrafficFiltersClientDeleteOptions contains the optional parameters for the TrafficFiltersClient.Delete method. func (client *TrafficFiltersClient) Delete(ctx context.Context, resourceGroupName string, monitorName string, options *TrafficFiltersClientDeleteOptions) (TrafficFiltersClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *TrafficFiltersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") if options != nil && options.RulesetID != nil { reqQP.Set("rulesetId", *options.RulesetID) } diff --git a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go deleted file mode 100644 index c2e1c28c65e8..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/trafficfilters_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_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/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/TrafficFilters_Delete.json -func ExampleTrafficFiltersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewTrafficFiltersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.TrafficFiltersClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go index 2756ca2a8488..4f38480d9ead 100644 --- a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go +++ b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client.go @@ -40,9 +40,9 @@ type UpgradableVersionsClient struct { } // NewUpgradableVersionsClient creates a new instance of UpgradableVersionsClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUpgradableVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UpgradableVersionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,11 +65,12 @@ func NewUpgradableVersionsClient(subscriptionID string, credential azcore.TokenC // Details - List of upgradable versions for a given monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - UpgradableVersionsClientDetailsOptions contains the optional parameters for the UpgradableVersionsClient.Details -// method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - UpgradableVersionsClientDetailsOptions contains the optional parameters for the UpgradableVersionsClient.Details +// method. func (client *UpgradableVersionsClient) Details(ctx context.Context, resourceGroupName string, monitorName string, options *UpgradableVersionsClientDetailsOptions) (UpgradableVersionsClientDetailsResponse, error) { req, err := client.detailsCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -105,7 +106,7 @@ func (client *UpgradableVersionsClient) detailsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go deleted file mode 100644 index 2d20a4d93ed9..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/upgradableversions_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/UpgradableVersions_Details.json -func ExampleUpgradableVersionsClient_Details() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewUpgradableVersionsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Details(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go b/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go index 9d408c9e3954..ba565c5d2331 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmcollection_client.go @@ -40,9 +40,9 @@ type VMCollectionClient struct { } // NewVMCollectionClient creates a new instance of VMCollectionClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVMCollectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VMCollectionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewVMCollectionClient(subscriptionID string, credential azcore.TokenCredent // Update - Update the vm details that will be monitored by the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - VMCollectionClientUpdateOptions contains the optional parameters for the VMCollectionClient.Update method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - VMCollectionClientUpdateOptions contains the optional parameters for the VMCollectionClient.Update method. func (client *VMCollectionClient) Update(ctx context.Context, resourceGroupName string, monitorName string, options *VMCollectionClientUpdateOptions) (VMCollectionClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *VMCollectionClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { diff --git a/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go deleted file mode 100644 index 2b7a78b82cd8..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmcollection_client_example_test.go +++ /dev/null @@ -1,34 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMCollection_Update.json -func ExampleVMCollectionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMCollectionClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, "myResourceGroup", "myMonitor", &armelastic.VMCollectionClientUpdateOptions{Body: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmhost_client.go b/sdk/resourcemanager/elastic/armelastic/vmhost_client.go index 5fcce2e69f40..b3c8e9284ee1 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmhost_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmhost_client.go @@ -40,9 +40,9 @@ type VMHostClient struct { } // NewVMHostClient creates a new instance of VMHostClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVMHostClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VMHostClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -64,10 +64,11 @@ func NewVMHostClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListPager - List the vm resources currently being monitored by the Elastic monitor resource. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - VMHostClientListOptions contains the optional parameters for the VMHostClient.List method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - VMHostClientListOptions contains the optional parameters for the VMHostClient.NewListPager method. func (client *VMHostClient) NewListPager(resourceGroupName string, monitorName string, options *VMHostClientListOptions) *runtime.Pager[VMHostClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VMHostClientListResponse]{ More: func(page VMHostClientListResponse) bool { @@ -116,7 +117,7 @@ func (client *VMHostClient) listCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go deleted file mode 100644 index 9ed96a8c9e30..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmhost_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMHost_List.json -func ExampleVMHostClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMHostClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "myMonitor", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go b/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go index 7c3d1b9734c4..863e4890d6af 100644 --- a/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go +++ b/sdk/resourcemanager/elastic/armelastic/vmingestion_client.go @@ -40,9 +40,9 @@ type VMIngestionClient struct { } // NewVMIngestionClient creates a new instance of VMIngestionClient with the specified values. -// subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVMIngestionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VMIngestionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -65,10 +65,11 @@ func NewVMIngestionClient(subscriptionID string, credential azcore.TokenCredenti // Details - List the vm ingestion details that will be monitored by the Elastic monitor resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group to which the Elastic resource belongs. -// monitorName - Monitor resource name -// options - VMIngestionClientDetailsOptions contains the optional parameters for the VMIngestionClient.Details method. +// +// Generated from API version 2022-09-01-preview +// - resourceGroupName - The name of the resource group to which the Elastic resource belongs. +// - monitorName - Monitor resource name +// - options - VMIngestionClientDetailsOptions contains the optional parameters for the VMIngestionClient.Details method. func (client *VMIngestionClient) Details(ctx context.Context, resourceGroupName string, monitorName string, options *VMIngestionClientDetailsOptions) (VMIngestionClientDetailsResponse, error) { req, err := client.detailsCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *VMIngestionClient) detailsCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-07-01-preview") + reqQP.Set("api-version", "2022-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go b/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go deleted file mode 100644 index ae43631a2b5c..000000000000 --- a/sdk/resourcemanager/elastic/armelastic/vmingestion_client_example_test.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armelastic_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/elastic/resource-manager/Microsoft.Elastic/preview/2022-07-01-preview/examples/VMIngestion_Details.json -func ExampleVMIngestionClient_Details() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armelastic.NewVMIngestionClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Details(ctx, "myResourceGroup", "myMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -}