diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/CHANGELOG.md b/sdk/resourcemanager/networkfunction/armnetworkfunction/CHANGELOG.md index d773a1ee5e51..b136c4c2aafb 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/CHANGELOG.md +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.1.1 (2023-08-09) +### Other Changes + + ## 2.1.0 (2023-03-31) ### Features Added diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/autorest.md b/sdk/resourcemanager/networkfunction/armnetworkfunction/autorest.md index 56bf15f0f5c3..faf0be8854fd 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/autorest.md +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkfunction/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/networkfunction/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.1.0 +module-version: 2.1.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client.go index f5359df79380..719e444ef66d 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction @@ -59,9 +58,10 @@ func (client *AzureTrafficCollectorsClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureTrafficCollectorsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureTrafficCollectorsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AzureTrafficCollectorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *AzureTrafficCollectorsClient) BeginCreateOrUpdate(ctx context.Cont // // Generated from API version 2022-11-01 func (client *AzureTrafficCollectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, parameters AzureTrafficCollector, options *AzureTrafficCollectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,7 +111,10 @@ func (client *AzureTrafficCollectorsClient) createOrUpdateCreateRequest(ctx cont reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a specified Azure Traffic Collector resource. @@ -126,9 +131,10 @@ func (client *AzureTrafficCollectorsClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureTrafficCollectorsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureTrafficCollectorsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AzureTrafficCollectorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,18 +145,20 @@ func (client *AzureTrafficCollectorsClient) BeginDelete(ctx context.Context, res // // Generated from API version 2022-11-01 func (client *AzureTrafficCollectorsClient) deleteOperation(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, options *AzureTrafficCollectorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -188,18 +196,21 @@ func (client *AzureTrafficCollectorsClient) deleteCreateRequest(ctx context.Cont // - options - AzureTrafficCollectorsClientGetOptions contains the optional parameters for the AzureTrafficCollectorsClient.Get // method. func (client *AzureTrafficCollectorsClient) Get(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, options *AzureTrafficCollectorsClientGetOptions) (AzureTrafficCollectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, options) if err != nil { return AzureTrafficCollectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureTrafficCollectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureTrafficCollectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureTrafficCollectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -247,18 +258,21 @@ func (client *AzureTrafficCollectorsClient) getHandleResponse(resp *http.Respons // - options - AzureTrafficCollectorsClientUpdateTagsOptions contains the optional parameters for the AzureTrafficCollectorsClient.UpdateTags // method. func (client *AzureTrafficCollectorsClient) UpdateTags(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, parameters TagsObject, options *AzureTrafficCollectorsClientUpdateTagsOptions) (AzureTrafficCollectorsClientUpdateTagsResponse, error) { + var err error req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, parameters, options) if err != nil { return AzureTrafficCollectorsClientUpdateTagsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AzureTrafficCollectorsClientUpdateTagsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AzureTrafficCollectorsClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureTrafficCollectorsClientUpdateTagsResponse{}, err } - return client.updateTagsHandleResponse(resp) + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err } // updateTagsCreateRequest creates the UpdateTags request. @@ -284,7 +298,10 @@ func (client *AzureTrafficCollectorsClient) updateTagsCreateRequest(ctx context. reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateTagsHandleResponse handles the UpdateTags response. diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client_example_test.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client_example_test.go deleted file mode 100644 index 74b3cdfafc4b..000000000000 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectors_client_example_test.go +++ /dev/null @@ -1,161 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkfunction_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/networkfunction/armnetworkfunction/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorGet.json -func ExampleAzureTrafficCollectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureTrafficCollectorsClient().Get(ctx, "rg1", "atc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{ - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{ - // CollectorPolicies: []*armnetworkfunction.ResourceReference{ - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorCreate.json -func ExampleAzureTrafficCollectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureTrafficCollectorsClient().BeginCreateOrUpdate(ctx, "rg1", "atc", armnetworkfunction.AzureTrafficCollector{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{ - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{ - // CollectorPolicies: []*armnetworkfunction.ResourceReference{ - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorDelete.json -func ExampleAzureTrafficCollectorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureTrafficCollectorsClient().BeginDelete(ctx, "rg1", "atc", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorUpdateTags.json -func ExampleAzureTrafficCollectorsClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureTrafficCollectorsClient().UpdateTags(ctx, "rg1", "atc", armnetworkfunction.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureTrafficCollector = armnetworkfunction.AzureTrafficCollector{ - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{ - // CollectorPolicies: []*armnetworkfunction.ResourceReference{ - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client.go index a7b927408835..93bf1adcc76d 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client_example_test.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client_example_test.go deleted file mode 100644 index 02e187c04cc9..000000000000 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbyresourcegroup_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkfunction_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkfunction/armnetworkfunction/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsByResourceGroupList.json -func ExampleAzureTrafficCollectorsByResourceGroupClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureTrafficCollectorsByResourceGroupClient().NewListPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureTrafficCollectorListResult = armnetworkfunction.AzureTrafficCollectorListResult{ - // Value: []*armnetworkfunction.AzureTrafficCollector{ - // { - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{ - // CollectorPolicies: []*armnetworkfunction.ResourceReference{ - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client.go index a30b5a51bcc2..b4eface408f5 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client_example_test.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client_example_test.go deleted file mode 100644 index aaffb66c6271..000000000000 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/azuretrafficcollectorsbysubscription_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkfunction_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkfunction/armnetworkfunction/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/AzureTrafficCollectorsBySubscriptionList.json -func ExampleAzureTrafficCollectorsBySubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureTrafficCollectorsBySubscriptionClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureTrafficCollectorListResult = armnetworkfunction.AzureTrafficCollectorListResult{ - // Value: []*armnetworkfunction.AzureTrafficCollector{ - // { - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Etag: to.Ptr("w/\\00000000-0000-0000-0000-000000000000\\"), - // Properties: &armnetworkfunction.AzureTrafficCollectorPropertiesFormat{ - // CollectorPolicies: []*armnetworkfunction.ResourceReference{ - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/client.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/client.go index 7813a0478ebd..8d1734edbb60 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/client.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/client_example_test.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/client_example_test.go deleted file mode 100644 index fffb7cfff84f..000000000000 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkfunction_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkfunction/armnetworkfunction/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/OperationsList.json -func ExampleClient_NewListOperationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClient().NewListOperationsPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnetworkfunction.OperationListResult{ - // Value: []*armnetworkfunction.Operation{ - // { - // Name: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/write"), - // Display: &armnetworkfunction.OperationDisplay{ - // Description: to.Ptr("Creates or Update a azure traffic collector"), - // Operation: to.Ptr("Create/Update a azure traffic collector"), - // Provider: to.Ptr("Microsoft NetworkFunction"), - // Resource: to.Ptr("AzureTrafficCollector"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/client_factory.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/client_factory.go index c47c0318b9f6..00e1631acb6a 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/client_factory.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction @@ -38,8 +37,8 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.credential, c.options) +func (c *ClientFactory) NewAzureTrafficCollectorsByResourceGroupClient() *AzureTrafficCollectorsByResourceGroupClient { + subClient, _ := NewAzureTrafficCollectorsByResourceGroupClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -48,13 +47,13 @@ func (c *ClientFactory) NewAzureTrafficCollectorsBySubscriptionClient() *AzureTr return subClient } -func (c *ClientFactory) NewAzureTrafficCollectorsByResourceGroupClient() *AzureTrafficCollectorsByResourceGroupClient { - subClient, _ := NewAzureTrafficCollectorsByResourceGroupClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAzureTrafficCollectorsClient() *AzureTrafficCollectorsClient { + subClient, _ := NewAzureTrafficCollectorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAzureTrafficCollectorsClient() *AzureTrafficCollectorsClient { - subClient, _ := NewAzureTrafficCollectorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewClient() *Client { + subClient, _ := NewClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client.go index 53b1ac28c0f5..38897dc2ea4e 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction @@ -60,9 +59,10 @@ func (client *CollectorPoliciesClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CollectorPoliciesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CollectorPoliciesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CollectorPoliciesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *CollectorPoliciesClient) BeginCreateOrUpdate(ctx context.Context, // // Generated from API version 2022-11-01 func (client *CollectorPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, parameters CollectorPolicy, options *CollectorPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -114,7 +116,10 @@ func (client *CollectorPoliciesClient) createOrUpdateCreateRequest(ctx context.C reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a specified Collector Policy resource. @@ -132,9 +137,10 @@ func (client *CollectorPoliciesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CollectorPoliciesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CollectorPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[CollectorPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,18 +151,20 @@ func (client *CollectorPoliciesClient) BeginDelete(ctx context.Context, resource // // Generated from API version 2022-11-01 func (client *CollectorPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, options *CollectorPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, collectorPolicyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -198,18 +206,21 @@ func (client *CollectorPoliciesClient) deleteCreateRequest(ctx context.Context, // - collectorPolicyName - Collector Policy Name // - options - CollectorPoliciesClientGetOptions contains the optional parameters for the CollectorPoliciesClient.Get method. func (client *CollectorPoliciesClient) Get(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, options *CollectorPoliciesClientGetOptions) (CollectorPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, collectorPolicyName, options) if err != nil { return CollectorPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CollectorPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CollectorPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CollectorPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -332,18 +343,21 @@ func (client *CollectorPoliciesClient) listHandleResponse(resp *http.Response) ( // - options - CollectorPoliciesClientUpdateTagsOptions contains the optional parameters for the CollectorPoliciesClient.UpdateTags // method. func (client *CollectorPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, azureTrafficCollectorName string, collectorPolicyName string, parameters TagsObject, options *CollectorPoliciesClientUpdateTagsOptions) (CollectorPoliciesClientUpdateTagsResponse, error) { + var err error req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, azureTrafficCollectorName, collectorPolicyName, parameters, options) if err != nil { return CollectorPoliciesClientUpdateTagsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CollectorPoliciesClientUpdateTagsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CollectorPoliciesClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CollectorPoliciesClientUpdateTagsResponse{}, err } - return client.updateTagsHandleResponse(resp) + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err } // updateTagsCreateRequest creates the UpdateTags request. @@ -373,7 +387,10 @@ func (client *CollectorPoliciesClient) updateTagsCreateRequest(ctx context.Conte reqQP.Set("api-version", "2022-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateTagsHandleResponse handles the UpdateTags response. diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client_example_test.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client_example_test.go deleted file mode 100644 index 38c4a491176f..000000000000 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/collectorpolicies_client_example_test.go +++ /dev/null @@ -1,265 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetworkfunction_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/networkfunction/armnetworkfunction/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPoliciesList.json -func ExampleCollectorPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCollectorPoliciesClient().NewListPager("rg1", "atc", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CollectorPolicyListResult = armnetworkfunction.CollectorPolicyListResult{ - // Value: []*armnetworkfunction.CollectorPolicy{ - // { - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"), - // Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{ - // EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{ - // { - // EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{ - // { - // DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor), - // }}, - // EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX), - // }}, - // IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{ - // IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{ - // { - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // SourceType: to.Ptr(armnetworkfunction.SourceTypeResource), - // }}, - // IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX), - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyGet.json -func ExampleCollectorPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCollectorPoliciesClient().Get(ctx, "rg1", "atc", "cp1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CollectorPolicy = armnetworkfunction.CollectorPolicy{ - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"), - // Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{ - // EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{ - // { - // EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{ - // { - // DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor), - // }}, - // EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX), - // }}, - // IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{ - // IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{ - // { - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // SourceType: to.Ptr(armnetworkfunction.SourceTypeResource), - // }}, - // IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX), - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyCreate.json -func ExampleCollectorPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCollectorPoliciesClient().BeginCreateOrUpdate(ctx, "rg1", "atc", "cp1", armnetworkfunction.CollectorPolicy{ - Location: to.Ptr("West US"), - Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{ - EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{ - { - EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{ - { - DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor), - }}, - EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX), - }}, - IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{ - IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{ - { - ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - SourceType: to.Ptr(armnetworkfunction.SourceTypeResource), - }}, - IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CollectorPolicy = armnetworkfunction.CollectorPolicy{ - // Name: to.Ptr("cp1"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/AzureTrafficCollector/atc/collectorPolicies/cp1"), - // Location: to.Ptr("westus"), - // Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"), - // Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{ - // EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{ - // { - // EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{ - // { - // DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor), - // }}, - // EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX), - // }}, - // IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{ - // IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{ - // { - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // SourceType: to.Ptr(armnetworkfunction.SourceTypeResource), - // }}, - // IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX), - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyDelete.json -func ExampleCollectorPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCollectorPoliciesClient().BeginDelete(ctx, "rg1", "atc", "cp1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/527f6d35fb0d85c48210ca0f6f6f42814d63bd33/specification/networkfunction/resource-manager/Microsoft.NetworkFunction/stable/2022-11-01/examples/CollectorPolicyUpdateTags.json -func ExampleCollectorPoliciesClient_UpdateTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetworkfunction.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCollectorPoliciesClient().UpdateTags(ctx, "rg1", "atc", "cp1", armnetworkfunction.TagsObject{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - "key2": to.Ptr("value2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CollectorPolicy = armnetworkfunction.CollectorPolicy{ - // Name: to.Ptr("atc"), - // Type: to.Ptr("Microsoft.NetworkFunction/azureTrafficCollectors/collectorPolicies"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/atc/collectorPolicies/cp1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // "key2": to.Ptr("value2"), - // }, - // Etag: to.Ptr("w/\\72090554-7e3b-43f2-80ad-99a9020dcb11\\"), - // Properties: &armnetworkfunction.CollectorPolicyPropertiesFormat{ - // EmissionPolicies: []*armnetworkfunction.EmissionPoliciesPropertiesFormat{ - // { - // EmissionDestinations: []*armnetworkfunction.EmissionPolicyDestination{ - // { - // DestinationType: to.Ptr(armnetworkfunction.DestinationTypeAzureMonitor), - // }}, - // EmissionType: to.Ptr(armnetworkfunction.EmissionTypeIPFIX), - // }}, - // IngestionPolicy: &armnetworkfunction.IngestionPolicyPropertiesFormat{ - // IngestionSources: []*armnetworkfunction.IngestionSourcesPropertiesFormat{ - // { - // ResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteCircuits/circuitName"), - // SourceType: to.Ptr(armnetworkfunction.SourceTypeResource), - // }}, - // IngestionType: to.Ptr(armnetworkfunction.IngestionTypeIPFIX), - // }, - // ProvisioningState: to.Ptr(armnetworkfunction.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/constants.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/constants.go index 33d4121da307..368b8584b5c9 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/constants.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction const ( moduleName = "armnetworkfunction" - moduleVersion = "v2.1.0" + moduleVersion = "v2.1.1" ) type APIVersionParameter string diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/go.mod b/sdk/resourcemanager/networkfunction/armnetworkfunction/go.mod index ff586a28d663..a0fc7e86fd3f 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/go.mod +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/networkfunction/arm go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/go.sum b/sdk/resourcemanager/networkfunction/armnetworkfunction/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/go.sum +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/models.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/models.go index c11d33011ba9..57f478832358 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/models.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction @@ -14,320 +13,249 @@ import "time" // AzureTrafficCollector - Azure Traffic Collector resource. type AzureTrafficCollector struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Properties of the Azure Traffic Collector. - Properties *AzureTrafficCollectorPropertiesFormat `json:"properties,omitempty"` + Properties *AzureTrafficCollectorPropertiesFormat // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *TrackedResourceSystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *TrackedResourceSystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AzureTrafficCollectorListResult - Response for the ListTrafficCollectors API service call. type AzureTrafficCollectorListResult struct { // A list of Traffic Collector resources. - Value []*AzureTrafficCollector `json:"value,omitempty"` + Value []*AzureTrafficCollector // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // AzureTrafficCollectorPropertiesFormat - Azure Traffic Collector resource properties. type AzureTrafficCollectorPropertiesFormat struct { // The virtualHub to which the Azure Traffic Collector belongs. - VirtualHub *ResourceReference `json:"virtualHub,omitempty"` + VirtualHub *ResourceReference // READ-ONLY; Collector Policies for Azure Traffic Collector. - CollectorPolicies []*ResourceReference `json:"collectorPolicies,omitempty" azure:"ro"` + CollectorPolicies []*ResourceReference // READ-ONLY; The provisioning state of the application rule collection resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` -} - -// AzureTrafficCollectorsByResourceGroupClientListOptions contains the optional parameters for the AzureTrafficCollectorsByResourceGroupClient.NewListPager -// method. -type AzureTrafficCollectorsByResourceGroupClientListOptions struct { - // placeholder for future optional parameters -} - -// AzureTrafficCollectorsBySubscriptionClientListOptions contains the optional parameters for the AzureTrafficCollectorsBySubscriptionClient.NewListPager -// method. -type AzureTrafficCollectorsBySubscriptionClientListOptions struct { - // placeholder for future optional parameters -} - -// AzureTrafficCollectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginCreateOrUpdate -// method. -type AzureTrafficCollectorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureTrafficCollectorsClientBeginDeleteOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginDelete -// method. -type AzureTrafficCollectorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AzureTrafficCollectorsClientGetOptions contains the optional parameters for the AzureTrafficCollectorsClient.Get method. -type AzureTrafficCollectorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AzureTrafficCollectorsClientUpdateTagsOptions contains the optional parameters for the AzureTrafficCollectorsClient.UpdateTags -// method. -type AzureTrafficCollectorsClientUpdateTagsOptions struct { - // placeholder for future optional parameters -} - -// ClientListOperationsOptions contains the optional parameters for the Client.NewListOperationsPager method. -type ClientListOperationsOptions struct { - // placeholder for future optional parameters -} - -// CollectorPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the CollectorPoliciesClient.BeginCreateOrUpdate -// method. -type CollectorPoliciesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CollectorPoliciesClientBeginDeleteOptions contains the optional parameters for the CollectorPoliciesClient.BeginDelete -// method. -type CollectorPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CollectorPoliciesClientGetOptions contains the optional parameters for the CollectorPoliciesClient.Get method. -type CollectorPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CollectorPoliciesClientListOptions contains the optional parameters for the CollectorPoliciesClient.NewListPager method. -type CollectorPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// CollectorPoliciesClientUpdateTagsOptions contains the optional parameters for the CollectorPoliciesClient.UpdateTags method. -type CollectorPoliciesClientUpdateTagsOptions struct { - // placeholder for future optional parameters + ProvisioningState *ProvisioningState } // CollectorPolicy - Collector policy resource. type CollectorPolicy struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Properties of the Collector Policy. - Properties *CollectorPolicyPropertiesFormat `json:"properties,omitempty"` + Properties *CollectorPolicyPropertiesFormat // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *TrackedResourceSystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *TrackedResourceSystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CollectorPolicyListResult - Response for the ListCollectorPolicies API service call. type CollectorPolicyListResult struct { // A list of collection policies. - Value []*CollectorPolicy `json:"value,omitempty"` + Value []*CollectorPolicy // READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // CollectorPolicyPropertiesFormat - Collection policy properties. type CollectorPolicyPropertiesFormat struct { // Emission policies. - EmissionPolicies []*EmissionPoliciesPropertiesFormat `json:"emissionPolicies,omitempty"` + EmissionPolicies []*EmissionPoliciesPropertiesFormat // Ingestion policies. - IngestionPolicy *IngestionPolicyPropertiesFormat `json:"ingestionPolicy,omitempty"` + IngestionPolicy *IngestionPolicyPropertiesFormat // READ-ONLY; The provisioning state. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // EmissionPoliciesPropertiesFormat - Emission policy properties. type EmissionPoliciesPropertiesFormat struct { // Emission policy destinations. - EmissionDestinations []*EmissionPolicyDestination `json:"emissionDestinations,omitempty"` + EmissionDestinations []*EmissionPolicyDestination // Emission format type. - EmissionType *EmissionType `json:"emissionType,omitempty"` + EmissionType *EmissionType } // EmissionPolicyDestination - Emission policy destination properties. type EmissionPolicyDestination struct { // Emission destination type. - DestinationType *DestinationType `json:"destinationType,omitempty"` + DestinationType *DestinationType } // IngestionPolicyPropertiesFormat - Ingestion Policy properties. type IngestionPolicyPropertiesFormat struct { // Ingestion Sources. - IngestionSources []*IngestionSourcesPropertiesFormat `json:"ingestionSources,omitempty"` + IngestionSources []*IngestionSourcesPropertiesFormat // The ingestion type. - IngestionType *IngestionType `json:"ingestionType,omitempty"` + IngestionType *IngestionType } // IngestionSourcesPropertiesFormat - Ingestion policy properties. type IngestionSourcesPropertiesFormat struct { // Resource ID. - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string // Ingestion source type. - SourceType *SourceType `json:"sourceType,omitempty"` + SourceType *SourceType } // Operation - Azure Traffic Collector REST API operation definition. type Operation struct { // Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // Indicates whether the operation is a data action - IsDataAction *bool `json:"isDataAction,omitempty"` + IsDataAction *bool // Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` + Name *string // Origin of the operation - Origin *string `json:"origin,omitempty"` + Origin *string } // OperationDisplay - Display metadata associated with the operation. type OperationDisplay struct { // Description of the operation. - Description *string `json:"description,omitempty"` + Description *string // Type of operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` + Operation *string // Service provider: Microsoft NetworkFunction. - Provider *string `json:"provider,omitempty"` + Provider *string // Resource on which the operation is performed etc. - Resource *string `json:"resource,omitempty"` + Resource *string } // OperationListResult - Result of the request to list Azure Traffic Collector operations. It contains a list of operations // and a URL link to get the next set of results. type OperationListResult struct { // URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // List of operations supported by the Azure Traffic Collector resource provider. - Value []*Operation `json:"value,omitempty"` + Value []*Operation } // ProxyResource - An azure resource object type ProxyResource struct { // READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Azure resource type - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceReference - Resource reference properties. type ResourceReference struct { // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } // TagsObject - Tags object for patch operations. type TagsObject struct { // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // TrackedResource - Common resource representation. type TrackedResource struct { // REQUIRED; Resource location. - Location *string `json:"location,omitempty"` + Location *string // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *TrackedResourceSystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *TrackedResourceSystemData // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TrackedResourceSystemData - Metadata pertaining to creation and last modification of the resource. type TrackedResourceSystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *CreatedByType } diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/models_serde.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/models_serde.go index 8468d2428ff8..64175043c2df 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/models_serde.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/options.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/options.go new file mode 100644 index 000000000000..00dcca0f0cc4 --- /dev/null +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/options.go @@ -0,0 +1,80 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armnetworkfunction + +// AzureTrafficCollectorsByResourceGroupClientListOptions contains the optional parameters for the AzureTrafficCollectorsByResourceGroupClient.NewListPager +// method. +type AzureTrafficCollectorsByResourceGroupClientListOptions struct { + // placeholder for future optional parameters +} + +// AzureTrafficCollectorsBySubscriptionClientListOptions contains the optional parameters for the AzureTrafficCollectorsBySubscriptionClient.NewListPager +// method. +type AzureTrafficCollectorsBySubscriptionClientListOptions struct { + // placeholder for future optional parameters +} + +// AzureTrafficCollectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginCreateOrUpdate +// method. +type AzureTrafficCollectorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureTrafficCollectorsClientBeginDeleteOptions contains the optional parameters for the AzureTrafficCollectorsClient.BeginDelete +// method. +type AzureTrafficCollectorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AzureTrafficCollectorsClientGetOptions contains the optional parameters for the AzureTrafficCollectorsClient.Get method. +type AzureTrafficCollectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureTrafficCollectorsClientUpdateTagsOptions contains the optional parameters for the AzureTrafficCollectorsClient.UpdateTags +// method. +type AzureTrafficCollectorsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ClientListOperationsOptions contains the optional parameters for the Client.NewListOperationsPager method. +type ClientListOperationsOptions struct { + // placeholder for future optional parameters +} + +// CollectorPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the CollectorPoliciesClient.BeginCreateOrUpdate +// method. +type CollectorPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CollectorPoliciesClientBeginDeleteOptions contains the optional parameters for the CollectorPoliciesClient.BeginDelete +// method. +type CollectorPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CollectorPoliciesClientGetOptions contains the optional parameters for the CollectorPoliciesClient.Get method. +type CollectorPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CollectorPoliciesClientListOptions contains the optional parameters for the CollectorPoliciesClient.NewListPager method. +type CollectorPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// CollectorPoliciesClientUpdateTagsOptions contains the optional parameters for the CollectorPoliciesClient.UpdateTags method. +type CollectorPoliciesClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/response_types.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/response_types.go index 2789205c87e7..3c19d81dffdf 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/response_types.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/response_types.go @@ -3,24 +3,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction // AzureTrafficCollectorsByResourceGroupClientListResponse contains the response from method AzureTrafficCollectorsByResourceGroupClient.NewListPager. type AzureTrafficCollectorsByResourceGroupClientListResponse struct { + // Response for the ListTrafficCollectors API service call. AzureTrafficCollectorListResult } // AzureTrafficCollectorsBySubscriptionClientListResponse contains the response from method AzureTrafficCollectorsBySubscriptionClient.NewListPager. type AzureTrafficCollectorsBySubscriptionClientListResponse struct { + // Response for the ListTrafficCollectors API service call. AzureTrafficCollectorListResult } // AzureTrafficCollectorsClientCreateOrUpdateResponse contains the response from method AzureTrafficCollectorsClient.BeginCreateOrUpdate. type AzureTrafficCollectorsClientCreateOrUpdateResponse struct { + // Azure Traffic Collector resource. AzureTrafficCollector } @@ -31,21 +33,26 @@ type AzureTrafficCollectorsClientDeleteResponse struct { // AzureTrafficCollectorsClientGetResponse contains the response from method AzureTrafficCollectorsClient.Get. type AzureTrafficCollectorsClientGetResponse struct { + // Azure Traffic Collector resource. AzureTrafficCollector } // AzureTrafficCollectorsClientUpdateTagsResponse contains the response from method AzureTrafficCollectorsClient.UpdateTags. type AzureTrafficCollectorsClientUpdateTagsResponse struct { + // Azure Traffic Collector resource. AzureTrafficCollector } // ClientListOperationsResponse contains the response from method Client.NewListOperationsPager. type ClientListOperationsResponse struct { + // Result of the request to list Azure Traffic Collector operations. It contains a list of operations and a URL link to get + // the next set of results. OperationListResult } // CollectorPoliciesClientCreateOrUpdateResponse contains the response from method CollectorPoliciesClient.BeginCreateOrUpdate. type CollectorPoliciesClientCreateOrUpdateResponse struct { + // Collector policy resource. CollectorPolicy } @@ -56,15 +63,18 @@ type CollectorPoliciesClientDeleteResponse struct { // CollectorPoliciesClientGetResponse contains the response from method CollectorPoliciesClient.Get. type CollectorPoliciesClientGetResponse struct { + // Collector policy resource. CollectorPolicy } // CollectorPoliciesClientListResponse contains the response from method CollectorPoliciesClient.NewListPager. type CollectorPoliciesClientListResponse struct { + // Response for the ListCollectorPolicies API service call. CollectorPolicyListResult } // CollectorPoliciesClientUpdateTagsResponse contains the response from method CollectorPoliciesClient.UpdateTags. type CollectorPoliciesClientUpdateTagsResponse struct { + // Collector policy resource. CollectorPolicy } diff --git a/sdk/resourcemanager/networkfunction/armnetworkfunction/time_rfc3339.go b/sdk/resourcemanager/networkfunction/armnetworkfunction/time_rfc3339.go index e16f0a44c5cd..2ec6130fd761 100644 --- a/sdk/resourcemanager/networkfunction/armnetworkfunction/time_rfc3339.go +++ b/sdk/resourcemanager/networkfunction/armnetworkfunction/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetworkfunction