diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md index ed177bf8c3ac..b2266bdb5f02 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 2.0.0 (2023-09-28) +### Breaking Changes + +- Function `*NetworkFabricsClient.BeginUpgrade` parameter(s) have been changed from `(context.Context, string, string, UpdateVersion, *NetworkFabricsClientBeginUpgradeOptions)` to `(context.Context, string, string, UpgradeNetworkFabricProperties, *NetworkFabricsClientBeginUpgradeOptions)` + +### Features Added + +- New value `ConfigurationStatePendingCommit`, `ConfigurationStateProvisioning` added to enum type `ConfigurationState` +- New enum type `NetworkFabricUpgradeAction` with values `NetworkFabricUpgradeActionComplete`, `NetworkFabricUpgradeActionStart` +- New struct `UpgradeNetworkFabricProperties` +- New field `DefaultAction` in struct `AccessControlListPatchProperties` +- New field `DefaultAction` in struct `AccessControlListProperties` +- New field `DefaultAction` in struct `RoutePolicyPatchableProperties` +- New field `DefaultAction` in struct `RoutePolicyProperties` + + ## 1.0.0 (2023-07-28) ### Breaking Changes diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go index e4bdb73a07a0..cd9da3851290 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *AccessControlListsClient) BeginCreate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *AccessControlListsClient) BeginCreate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) create(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlList, options *AccessControlListsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accessControlListName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *AccessControlListsClient) createCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements Access Control List DELETE method. @@ -123,9 +128,10 @@ func (client *AccessControlListsClient) BeginDelete(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *AccessControlListsClient) BeginDelete(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) deleteOperation(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accessControlListName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *AccessControlListsClient) deleteCreateRequest(ctx context.Context, // - accessControlListName - Name of the Access Control List. // - options - AccessControlListsClientGetOptions contains the optional parameters for the AccessControlListsClient.Get method. func (client *AccessControlListsClient) Get(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientGetOptions) (AccessControlListsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accessControlListName, options) if err != nil { return AccessControlListsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AccessControlListsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccessControlListsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccessControlListsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -360,9 +371,10 @@ func (client *AccessControlListsClient) BeginResync(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientResyncResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientResyncResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -373,18 +385,20 @@ func (client *AccessControlListsClient) BeginResync(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) resync(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginResyncOptions) (*http.Response, error) { + var err error req, err := client.resyncCreateRequest(ctx, resourceGroupName, accessControlListName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncCreateRequest creates the Resync request. @@ -425,9 +439,10 @@ func (client *AccessControlListsClient) BeginUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -438,18 +453,20 @@ func (client *AccessControlListsClient) BeginUpdate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) update(ctx context.Context, resourceGroupName string, accessControlListName string, body AccessControlListPatch, options *AccessControlListsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accessControlListName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -472,7 +489,10 @@ func (client *AccessControlListsClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Implements the operation to the underlying resources. @@ -490,9 +510,10 @@ func (client *AccessControlListsClient) BeginUpdateAdministrativeState(ctx conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -503,18 +524,20 @@ func (client *AccessControlListsClient) BeginUpdateAdministrativeState(ctx conte // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, accessControlListName string, body UpdateAdministrativeState, options *AccessControlListsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, accessControlListName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -537,7 +560,10 @@ func (client *AccessControlListsClient) updateAdministrativeStateCreateRequest(c reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Implements the operation to the underlying resources. @@ -554,9 +580,10 @@ func (client *AccessControlListsClient) BeginValidateConfiguration(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccessControlListsClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccessControlListsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -567,18 +594,20 @@ func (client *AccessControlListsClient) BeginValidateConfiguration(ctx context.C // // Generated from API version 2023-06-15 func (client *AccessControlListsClient) validateConfiguration(ctx context.Context, resourceGroupName string, accessControlListName string, options *AccessControlListsClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, accessControlListName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go deleted file mode 100644 index 47ff6c69c4cf..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/accesscontrollists_client_example_test.go +++ /dev/null @@ -1,956 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Create_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginCreate(ctx, "example-rg", "example-acl", armmanagednetworkfabric.AccessControlList{ - Location: to.Ptr("eastUs"), - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.AccessControlListProperties{ - ACLsURL: to.Ptr("https://ACL-Storage-URL"), - ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - { - IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - { - Name: to.Ptr("example-ipGroup"), - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - IPPrefixes: []*string{ - to.Ptr("10.20.3.1/20")}, - }}, - PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - { - Name: to.Ptr("example-portGroup"), - Ports: []*string{ - to.Ptr("100-200")}, - }}, - VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - { - Name: to.Ptr("example-vlanGroup"), - Vlans: []*string{ - to.Ptr("20-30")}, - }}, - }}, - MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - { - Actions: []*armmanagednetworkfabric.AccessControlListAction{ - { - Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - CounterName: to.Ptr("example-counter"), - }}, - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - { - IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - IPGroupNames: []*string{ - to.Ptr("example-ipGroup")}, - IPPrefixValues: []*string{ - to.Ptr("10.20.20.20/12")}, - PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - }, - ProtocolTypes: []*string{ - to.Ptr("TCP")}, - VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - InnerVlans: []*string{ - to.Ptr("30")}, - VlanGroupNames: []*string{ - to.Ptr("example-vlanGroup")}, - Vlans: []*string{ - to.Ptr("20-30")}, - }, - DscpMarkings: []*string{ - to.Ptr("32")}, - EtherTypes: []*string{ - to.Ptr("0x1")}, - Fragments: []*string{ - to.Ptr("0xff00-0xffff")}, - IPLengths: []*string{ - to.Ptr("4094-9214")}, - PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - PortGroupNames: []*string{ - to.Ptr("example-portGroup")}, - PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - Ports: []*string{ - to.Ptr("1-20")}, - Flags: []*string{ - to.Ptr("established")}, - }, - TTLValues: []*string{ - to.Ptr("23")}, - }}, - MatchConfigurationName: to.Ptr("example-match"), - SequenceNumber: to.Ptr[int64](123), - }}, - Annotation: to.Ptr("annotation"), - }, - }, 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.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("example-acl"), - // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastUs"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // ACLsURL: to.Ptr("https://ACL-Storage-URL"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.20.3.1/20")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("example-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.AccessControlListAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - // CounterName: to.Ptr("example-counter"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.20.20.20/12")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("30")}, - // VlanGroupNames: []*string{ - // to.Ptr("example-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }, - // DscpMarkings: []*string{ - // to.Ptr("32")}, - // EtherTypes: []*string{ - // to.Ptr("0x1")}, - // Fragments: []*string{ - // to.Ptr("0xff00-0xffff")}, - // IPLengths: []*string{ - // to.Ptr("4094-9214")}, - // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("1-20")}, - // Flags: []*string{ - // to.Ptr("established")}, - // }, - // TTLValues: []*string{ - // to.Ptr("23")}, - // }}, - // MatchConfigurationName: to.Ptr("example-match"), - // SequenceNumber: to.Ptr[int64](123), - // }}, - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Get_MaximumSet_Gen.json -func ExampleAccessControlListsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccessControlListsClient().Get(ctx, "example-rg", "example-acl", 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.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("example-acl"), - // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastUs"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // ACLsURL: to.Ptr("https://ACL-Storage-URL"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.20.3.1/20")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("example-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.AccessControlListAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - // CounterName: to.Ptr("example-counter"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.20.20.20/12")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("30")}, - // VlanGroupNames: []*string{ - // to.Ptr("example-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }, - // DscpMarkings: []*string{ - // to.Ptr("32")}, - // EtherTypes: []*string{ - // to.Ptr("0x1")}, - // Fragments: []*string{ - // to.Ptr("0xff00-0xffff")}, - // IPLengths: []*string{ - // to.Ptr("4094-9214")}, - // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("1-20")}, - // Flags: []*string{ - // to.Ptr("established")}, - // }, - // TTLValues: []*string{ - // to.Ptr("23")}, - // }}, - // MatchConfigurationName: to.Ptr("example-match"), - // SequenceNumber: to.Ptr[int64](123), - // }}, - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Update_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginUpdate(ctx, "example-rg", "example-acl", armmanagednetworkfabric.AccessControlListPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.AccessControlListPatchProperties{ - ACLsURL: to.Ptr("https://microsoft.com/a"), - ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - { - IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - { - Name: to.Ptr("example-ipGroup"), - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - IPPrefixes: []*string{ - to.Ptr("10.20.3.1/20")}, - }}, - PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - { - Name: to.Ptr("example-portGroup"), - Ports: []*string{ - to.Ptr("100-200")}, - }}, - VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - { - Name: to.Ptr("example-vlanGroup"), - Vlans: []*string{ - to.Ptr("20-30")}, - }}, - }}, - MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - { - Actions: []*armmanagednetworkfabric.AccessControlListAction{ - { - Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - CounterName: to.Ptr("example-counter"), - }}, - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - { - IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - IPGroupNames: []*string{ - to.Ptr("example-ipGroup")}, - IPPrefixValues: []*string{ - to.Ptr("10.20.20.20/12")}, - PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - }, - ProtocolTypes: []*string{ - to.Ptr("TCP")}, - VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - InnerVlans: []*string{ - to.Ptr("30")}, - VlanGroupNames: []*string{ - to.Ptr("example-vlanGroup")}, - Vlans: []*string{ - to.Ptr("20-30")}, - }, - DscpMarkings: []*string{ - to.Ptr("32")}, - EtherTypes: []*string{ - to.Ptr("0x1")}, - Fragments: []*string{ - to.Ptr("0xff00-0xffff")}, - IPLengths: []*string{ - to.Ptr("4094-9214")}, - PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - PortGroupNames: []*string{ - to.Ptr("example-portGroup")}, - PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - Ports: []*string{ - to.Ptr("1-20")}, - Flags: []*string{ - to.Ptr("established")}, - }, - TTLValues: []*string{ - to.Ptr("23")}, - }}, - MatchConfigurationName: to.Ptr("example-match"), - SequenceNumber: to.Ptr[int64](123), - }}, - Annotation: to.Ptr("annotation"), - }, - }, 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.AccessControlList = armmanagednetworkfabric.AccessControlList{ - // Name: to.Ptr("example-acl"), - // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastUs"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // ACLsURL: to.Ptr("https://ACL-Storage-URL"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.20.3.1/20")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("example-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.AccessControlListAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - // CounterName: to.Ptr("example-counter"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.20.20.20/12")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("30")}, - // VlanGroupNames: []*string{ - // to.Ptr("example-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }, - // DscpMarkings: []*string{ - // to.Ptr("32")}, - // EtherTypes: []*string{ - // to.Ptr("0x1")}, - // Fragments: []*string{ - // to.Ptr("0xff00-0xffff")}, - // IPLengths: []*string{ - // to.Ptr("4094-9214")}, - // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("1-20")}, - // Flags: []*string{ - // to.Ptr("established")}, - // }, - // TTLValues: []*string{ - // to.Ptr("23")}, - // }}, - // MatchConfigurationName: to.Ptr("example-match"), - // SequenceNumber: to.Ptr[int64](123), - // }}, - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Delete_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginDelete(ctx, "example-rg", "example-acl", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListByResourceGroup_MaximumSet_Gen.json -func ExampleAccessControlListsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccessControlListsClient().NewListByResourceGroupPager("example-rg", 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.AccessControlListsListResult = armmanagednetworkfabric.AccessControlListsListResult{ - // Value: []*armmanagednetworkfabric.AccessControlList{ - // { - // Name: to.Ptr("example-acl"), - // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastUs"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // ACLsURL: to.Ptr("https://ACL-Storage-URL"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.20.3.1/20")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("example-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.AccessControlListAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - // CounterName: to.Ptr("example-counter"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.20.20.20/12")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("30")}, - // VlanGroupNames: []*string{ - // to.Ptr("example-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }, - // DscpMarkings: []*string{ - // to.Ptr("32")}, - // EtherTypes: []*string{ - // to.Ptr("0x1")}, - // Fragments: []*string{ - // to.Ptr("0xff00-0xffff")}, - // IPLengths: []*string{ - // to.Ptr("4094-9214")}, - // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("1-20")}, - // Flags: []*string{ - // to.Ptr("established")}, - // }, - // TTLValues: []*string{ - // to.Ptr("23")}, - // }}, - // MatchConfigurationName: to.Ptr("example-match"), - // SequenceNumber: to.Ptr[int64](123), - // }}, - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ListBySubscription_MaximumSet_Gen.json -func ExampleAccessControlListsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccessControlListsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AccessControlListsListResult = armmanagednetworkfabric.AccessControlListsListResult{ - // Value: []*armmanagednetworkfabric.AccessControlList{ - // { - // Name: to.Ptr("example-acl"), - // Type: to.Ptr("microsoft.managednetworkfabric/accessControlLists"), - // ID: to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastUs"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.AccessControlListProperties{ - // ACLsURL: to.Ptr("https://ACL-Storage-URL"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.20.3.1/20")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("example-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.AccessControlListMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.AccessControlListAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.ACLActionTypeCount), - // CounterName: to.Ptr("example-counter"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.AccessControlListMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.20.20.20/12")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("30")}, - // VlanGroupNames: []*string{ - // to.Ptr("example-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("20-30")}, - // }, - // DscpMarkings: []*string{ - // to.Ptr("32")}, - // EtherTypes: []*string{ - // to.Ptr("0x1")}, - // Fragments: []*string{ - // to.Ptr("0xff00-0xffff")}, - // IPLengths: []*string{ - // to.Ptr("4094-9214")}, - // PortCondition: &armmanagednetworkfabric.AccessControlListPortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("1-20")}, - // Flags: []*string{ - // to.Ptr("established")}, - // }, - // TTLValues: []*string{ - // to.Ptr("23")}, - // }}, - // MatchConfigurationName: to.Ptr("example-match"), - // SequenceNumber: to.Ptr[int64](123), - // }}, - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-17T08:56:23.203Z"); return t}()), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-acl", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_Resync_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginResync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginResync(ctx, "example-rg", "example-acl", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/AccessControlLists_ValidateConfiguration_MaximumSet_Gen.json -func ExampleAccessControlListsClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccessControlListsClient().BeginValidateConfiguration(ctx, "example-rg", "example-acl", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md index 4e3b76e283a8..579fb9117821 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/managednetworkfabric/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/managednetworkfabric/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-06-15 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go index cb20602013ef..dab4c4e4e74f 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/client_factory.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/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 armmanagednetworkfabric @@ -43,13 +42,8 @@ func (c *ClientFactory) NewAccessControlListsClient() *AccessControlListsClient return subClient } -func (c *ClientFactory) NewInternetGatewaysClient() *InternetGatewaysClient { - subClient, _ := NewInternetGatewaysClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewInternetGatewayRulesClient() *InternetGatewayRulesClient { - subClient, _ := NewInternetGatewayRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewExternalNetworksClient() *ExternalNetworksClient { + subClient, _ := NewExternalNetworksClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -68,23 +62,28 @@ func (c *ClientFactory) NewIPPrefixesClient() *IPPrefixesClient { return subClient } -func (c *ClientFactory) NewL2IsolationDomainsClient() *L2IsolationDomainsClient { - subClient, _ := NewL2IsolationDomainsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewInternalNetworksClient() *InternalNetworksClient { + subClient, _ := NewInternalNetworksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewL3IsolationDomainsClient() *L3IsolationDomainsClient { - subClient, _ := NewL3IsolationDomainsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewInternetGatewayRulesClient() *InternetGatewayRulesClient { + subClient, _ := NewInternetGatewayRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewInternalNetworksClient() *InternalNetworksClient { - subClient, _ := NewInternalNetworksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewInternetGatewaysClient() *InternetGatewaysClient { + subClient, _ := NewInternetGatewaysClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewExternalNetworksClient() *ExternalNetworksClient { - subClient, _ := NewExternalNetworksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewL2IsolationDomainsClient() *L2IsolationDomainsClient { + subClient, _ := NewL2IsolationDomainsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewL3IsolationDomainsClient() *L3IsolationDomainsClient { + subClient, _ := NewL3IsolationDomainsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -103,11 +102,6 @@ func (c *ClientFactory) NewNetworkDevicesClient() *NetworkDevicesClient { return subClient } -func (c *ClientFactory) NewNetworkInterfacesClient() *NetworkInterfacesClient { - subClient, _ := NewNetworkInterfacesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewNetworkFabricControllersClient() *NetworkFabricControllersClient { subClient, _ := NewNetworkFabricControllersClient(c.subscriptionID, c.credential, c.options) return subClient @@ -123,8 +117,8 @@ func (c *ClientFactory) NewNetworkFabricsClient() *NetworkFabricsClient { return subClient } -func (c *ClientFactory) NewNetworkToNetworkInterconnectsClient() *NetworkToNetworkInterconnectsClient { - subClient, _ := NewNetworkToNetworkInterconnectsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNetworkInterfacesClient() *NetworkInterfacesClient { + subClient, _ := NewNetworkInterfacesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -148,6 +142,11 @@ func (c *ClientFactory) NewNetworkTapsClient() *NetworkTapsClient { return subClient } +func (c *ClientFactory) NewNetworkToNetworkInterconnectsClient() *NetworkToNetworkInterconnectsClient { + subClient, _ := NewNetworkToNetworkInterconnectsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go index 75d20256a336..26fcc3b595cc 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/constants.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/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 armmanagednetworkfabric const ( moduleName = "armmanagednetworkfabric" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // ACLActionType - Type of actions that can be performed. @@ -197,7 +196,9 @@ const ( ConfigurationStateErrorDeprovisioning ConfigurationState = "ErrorDeprovisioning" ConfigurationStateErrorProvisioning ConfigurationState = "ErrorProvisioning" ConfigurationStateFailed ConfigurationState = "Failed" + ConfigurationStatePendingCommit ConfigurationState = "PendingCommit" ConfigurationStateProvisioned ConfigurationState = "Provisioned" + ConfigurationStateProvisioning ConfigurationState = "Provisioning" ConfigurationStateRejected ConfigurationState = "Rejected" ConfigurationStateSucceeded ConfigurationState = "Succeeded" ) @@ -212,7 +213,9 @@ func PossibleConfigurationStateValues() []ConfigurationState { ConfigurationStateErrorDeprovisioning, ConfigurationStateErrorProvisioning, ConfigurationStateFailed, + ConfigurationStatePendingCommit, ConfigurationStateProvisioned, + ConfigurationStateProvisioning, ConfigurationStateRejected, ConfigurationStateSucceeded, } @@ -322,7 +325,7 @@ func PossibleEncapsulationValues() []Encapsulation { } } -// EncapsulationType - Encapsulation Type. +// EncapsulationType - Encapsulation Type that needs to be matched. type EncapsulationType string const ( @@ -528,6 +531,22 @@ func PossibleNetworkDeviceRoleNameValues() []NetworkDeviceRoleName { } } +// NetworkFabricUpgradeAction - Action to be performed while upgrading the fabric. +type NetworkFabricUpgradeAction string + +const ( + NetworkFabricUpgradeActionComplete NetworkFabricUpgradeAction = "Complete" + NetworkFabricUpgradeActionStart NetworkFabricUpgradeAction = "Start" +) + +// PossibleNetworkFabricUpgradeActionValues returns the possible values for the NetworkFabricUpgradeAction const type. +func PossibleNetworkFabricUpgradeActionValues() []NetworkFabricUpgradeAction { + return []NetworkFabricUpgradeAction{ + NetworkFabricUpgradeActionComplete, + NetworkFabricUpgradeActionStart, + } +} + // NetworkRackType - Network Rack SKU name. type NetworkRackType string @@ -667,7 +686,7 @@ func PossiblePortTypeValues() []PortType { } } -// PrefixType - IP Prefix Type. +// PrefixType - IP Prefix Type that needs to be matched. type PrefixType string const ( @@ -793,7 +812,7 @@ func PossibleRoutePolicyConditionTypeValues() []RoutePolicyConditionType { } } -// SourceDestinationType - IP Address type. +// SourceDestinationType - IP Address type that needs to be matched. type SourceDestinationType string const ( diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go index 33192b8be923..fe77bb5c647c 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_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 armmanagednetworkfabric @@ -60,9 +59,10 @@ func (client *ExternalNetworksClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *ExternalNetworksClient) BeginCreate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *ExternalNetworksClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetwork, options *ExternalNetworksClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,7 +113,10 @@ func (client *ExternalNetworksClient) createCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements ExternalNetworks DELETE method. @@ -129,9 +134,10 @@ func (client *ExternalNetworksClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *ExternalNetworksClient) BeginDelete(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *ExternalNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,18 +200,21 @@ func (client *ExternalNetworksClient) deleteCreateRequest(ctx context.Context, r // - externalNetworkName - Name of the External Network. // - options - ExternalNetworksClientGetOptions contains the optional parameters for the ExternalNetworksClient.Get method. func (client *ExternalNetworksClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, options *ExternalNetworksClientGetOptions) (ExternalNetworksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, options) if err != nil { return ExternalNetworksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExternalNetworksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExternalNetworksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExternalNetworksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -325,9 +336,10 @@ func (client *ExternalNetworksClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -338,18 +350,20 @@ func (client *ExternalNetworksClient) BeginUpdate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *ExternalNetworksClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body ExternalNetworkPatch, options *ExternalNetworksClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -376,7 +390,10 @@ func (client *ExternalNetworksClient) updateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Executes update operation to enable or disable administrative State for externalNetwork. @@ -395,9 +412,10 @@ func (client *ExternalNetworksClient) BeginUpdateAdministrativeState(ctx context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -408,18 +426,20 @@ func (client *ExternalNetworksClient) BeginUpdateAdministrativeState(ctx context // // Generated from API version 2023-06-15 func (client *ExternalNetworksClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -446,7 +466,10 @@ func (client *ExternalNetworksClient) updateAdministrativeStateCreateRequest(ctx reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateStaticRouteBfdAdministrativeState - Update Static Route BFD for external Network. @@ -465,9 +488,10 @@ func (client *ExternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeSta if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -478,18 +502,20 @@ func (client *ExternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeSta // // Generated from API version 2023-06-15 func (client *ExternalNetworksClient) updateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, externalNetworkName string, body UpdateAdministrativeState, options *ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, externalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateStaticRouteBfdAdministrativeState request. @@ -516,5 +542,8 @@ func (client *ExternalNetworksClient) updateStaticRouteBfdAdministrativeStateCre reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go deleted file mode 100644 index c619b87de2a8..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/externalnetworks_client_example_test.go +++ /dev/null @@ -1,572 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Create_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginCreate(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetwork{ - Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - Annotation: to.Ptr("annotation"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](15), - }, - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int64](65047), - VlanID: to.Ptr[int32](1001), - PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - }, - OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10039")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - }, - }, 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.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // FabricASN: to.Ptr[int64](1234), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](65047), - // VlanID: to.Ptr[int32](1001), - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // }, - // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Get_MaximumSet_Gen.json -func ExampleExternalNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExternalNetworksClient().Get(ctx, "rgL3IsolationDomains", "yhtr", "fltpszzikbalrzaqq", 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.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // FabricASN: to.Ptr[int64](1234), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](65047), - // VlanID: to.Ptr[int32](1001), - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // }, - // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Update_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdate(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.ExternalNetworkPatch{ - Properties: &armmanagednetworkfabric.ExternalNetworkPatchProperties{ - Annotation: to.Ptr("annotation1"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPatchPropertiesOptionAProperties{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](15), - }, - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int64](65047), - VlanID: to.Ptr[int32](1001), - PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - }, - OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10039")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - }, - }, 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.ExternalNetwork = armmanagednetworkfabric.ExternalNetwork{ - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // FabricASN: to.Ptr[int64](1234), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](65047), - // VlanID: to.Ptr[int32](1001), - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // }, - // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_Delete_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginDelete(ctx, "example-rg", "example-l3domain", "example-externalnetwork", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json -func ExampleExternalNetworksClient_NewListByL3IsolationDomainPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalNetworksClient().NewListByL3IsolationDomainPager("example-rg", "example-l3domain", 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.ExternalNetworksList = armmanagednetworkfabric.ExternalNetworksList{ - // Value: []*armmanagednetworkfabric.ExternalNetwork{ - // { - // Name: to.Ptr("example-externalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/externalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.ExternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.ExternalNetworkPropertiesOptionAProperties{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // FabricASN: to.Ptr[int64](1234), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](65047), - // VlanID: to.Ptr[int32](1001), - // PrimaryIPv4Prefix: to.Ptr("10.1.1.0/30"), - // PrimaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/126"), - // SecondaryIPv4Prefix: to.Ptr("10.1.1.4/30"), - // SecondaryIPv6Prefix: to.Ptr("3FFE:FFFF:0:CD30::a4/126"), - // }, - // OptionBProperties: &armmanagednetworkfabric.L3OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10039")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ExternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json -func ExampleExternalNetworksClient_BeginUpdateStaticRouteBfdAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExternalNetworksClient().BeginUpdateStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-l3domain", "example-externalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.mod b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.mod index c3a0e13e02e1..c16fbeb61c28 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.mod +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.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.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.sum b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.sum index 21718b486698..727ce838bdc8 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.sum +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +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/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -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.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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/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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go index 3a0002fc21ac..84d594021d68 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_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 armmanagednetworkfabric @@ -60,9 +59,10 @@ func (client *InternalNetworksClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *InternalNetworksClient) BeginCreate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetwork, options *InternalNetworksClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,7 +113,10 @@ func (client *InternalNetworksClient) createCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements InternalNetworks DELETE method. @@ -129,9 +134,10 @@ func (client *InternalNetworksClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *InternalNetworksClient) BeginDelete(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,18 +200,21 @@ func (client *InternalNetworksClient) deleteCreateRequest(ctx context.Context, r // - internalNetworkName - Name of the Internal Network. // - options - InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. func (client *InternalNetworksClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, options *InternalNetworksClientGetOptions) (InternalNetworksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, options) if err != nil { return InternalNetworksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InternalNetworksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InternalNetworksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InternalNetworksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -325,9 +336,10 @@ func (client *InternalNetworksClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -338,18 +350,20 @@ func (client *InternalNetworksClient) BeginUpdate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body InternalNetworkPatch, options *InternalNetworksClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -376,7 +390,10 @@ func (client *InternalNetworksClient) updateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Update Administrative state of InternalNetworks on resources referred by their resource @@ -396,9 +413,10 @@ func (client *InternalNetworksClient) BeginUpdateAdministrativeState(ctx context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -409,18 +427,20 @@ func (client *InternalNetworksClient) BeginUpdateAdministrativeState(ctx context // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -447,7 +467,10 @@ func (client *InternalNetworksClient) updateAdministrativeStateCreateRequest(ctx reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateBgpAdministrativeState - Update BGP state for internalNetwork. Allowed only on edge devices. @@ -466,9 +489,10 @@ func (client *InternalNetworksClient) BeginUpdateBgpAdministrativeState(ctx cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBgpAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateBgpAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateBgpAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -479,18 +503,20 @@ func (client *InternalNetworksClient) BeginUpdateBgpAdministrativeState(ctx cont // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) updateBgpAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateBgpAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateBgpAdministrativeStateCreateRequest creates the UpdateBgpAdministrativeState request. @@ -517,7 +543,10 @@ func (client *InternalNetworksClient) updateBgpAdministrativeStateCreateRequest( reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateStaticRouteBfdAdministrativeState - Update Static Route BFD administrative state for internalNetwork. @@ -536,9 +565,10 @@ func (client *InternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeSta if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -549,18 +579,20 @@ func (client *InternalNetworksClient) BeginUpdateStaticRouteBfdAdministrativeSta // // Generated from API version 2023-06-15 func (client *InternalNetworksClient) updateStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, internalNetworkName string, body UpdateAdministrativeState, options *InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, internalNetworkName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateStaticRouteBfdAdministrativeState request. @@ -587,5 +619,8 @@ func (client *InternalNetworksClient) updateStaticRouteBfdAdministrativeStateCre reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go deleted file mode 100644 index 242e67a99ee7..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internalnetworks_client_example_test.go +++ /dev/null @@ -1,777 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Create_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginCreate(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetwork{ - Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - Annotation: to.Ptr("annotation"), - Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Annotation: to.Ptr("annotation"), - Prefix: to.Ptr("10.0.0.0/24"), - }}, - ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Annotation: to.Ptr("annotation"), - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - Mtu: to.Ptr[int32](1500), - BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ - Annotation: to.Ptr("annotation"), - AllowAS: to.Ptr[int32](10), - AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](5), - }, - DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - IPv4ListenRangePrefixes: []*string{ - to.Ptr("10.1.0.0/25")}, - IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - { - Address: to.Ptr("10.1.0.0"), - }}, - IPv6ListenRangePrefixes: []*string{ - to.Ptr("2fff::/66")}, - IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - { - Address: to.Ptr("2fff::"), - }}, - PeerASN: to.Ptr[int64](61234), - }, - StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ - Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](15), - }, - IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("10.0.0.1")}, - Prefix: to.Ptr("jffgck"), - }}, - IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("3ffe::1")}, - Prefix: to.Ptr("2fff::/64"), - }}, - }, - VlanID: to.Ptr[int32](755), - }, - }, 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.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-internalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - // Mtu: to.Ptr[int32](1500), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ - // Annotation: to.Ptr("annotation"), - // AllowAS: to.Ptr[int32](10), - // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int64](20), - // IPv4ListenRangePrefixes: []*string{ - // to.Ptr("10.1.0.0/25")}, - // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("10.1.0.0"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // IPv6ListenRangePrefixes: []*string{ - // to.Ptr("2fff::/66")}, - // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("2fff::"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // PeerASN: to.Ptr[int64](61234), - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("jffgck"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("3ffe::1")}, - // Prefix: to.Ptr("2fff::/64"), - // }}, - // }, - // VlanID: to.Ptr[int32](755), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Get_MaximumSet_Gen.json -func ExampleInternalNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInternalNetworksClient().Get(ctx, "example-rg", "example-l3domain", "example-internalnetwork", 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.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-internalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - // Mtu: to.Ptr[int32](1500), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ - // Annotation: to.Ptr("annotation"), - // AllowAS: to.Ptr[int32](10), - // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int64](20), - // IPv4ListenRangePrefixes: []*string{ - // to.Ptr("10.1.0.0/25")}, - // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("10.1.0.0"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // IPv6ListenRangePrefixes: []*string{ - // to.Ptr("2fff::/66")}, - // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("2fff::"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // PeerASN: to.Ptr[int64](61234), - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("jffgck"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("3ffe::1")}, - // Prefix: to.Ptr("2fff::/64"), - // }}, - // }, - // VlanID: to.Ptr[int32](755), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Update_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdate(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.InternalNetworkPatch{ - Properties: &armmanagednetworkfabric.InternalNetworkPatchProperties{ - Annotation: to.Ptr("annotation"), - ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Annotation: to.Ptr("annotation"), - Prefix: to.Ptr("10.0.0.0/24"), - }}, - ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - { - Annotation: to.Ptr("annotation"), - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - Mtu: to.Ptr[int32](1500), - BgpConfiguration: &armmanagednetworkfabric.BgpConfiguration{ - Annotation: to.Ptr("annotation"), - AllowAS: to.Ptr[int32](10), - AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](5), - }, - DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - IPv4ListenRangePrefixes: []*string{ - to.Ptr("10.1.0.0/25")}, - IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - { - Address: to.Ptr("10.1.0.0"), - }}, - IPv6ListenRangePrefixes: []*string{ - to.Ptr("2fff::/66")}, - IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - { - Address: to.Ptr("2fff::"), - }}, - PeerASN: to.Ptr[int64](61234), - }, - StaticRouteConfiguration: &armmanagednetworkfabric.StaticRouteConfiguration{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](15), - }, - IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("10.0.0.1")}, - Prefix: to.Ptr("20.20.20.20/25"), - }}, - IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("3ffe::1")}, - Prefix: to.Ptr("2fff::/64"), - }}, - }, - }, - }, 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.InternalNetwork = armmanagednetworkfabric.InternalNetwork{ - // Name: to.Ptr("example-internalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - // Mtu: to.Ptr[int32](1500), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ - // Annotation: to.Ptr("annotation"), - // AllowAS: to.Ptr[int32](10), - // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int64](20), - // IPv4ListenRangePrefixes: []*string{ - // to.Ptr("10.1.0.0/25")}, - // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("10.1.0.0"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // IPv6ListenRangePrefixes: []*string{ - // to.Ptr("2fff::/66")}, - // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("2fff::"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // PeerASN: to.Ptr[int64](61234), - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("jffgck"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("3ffe::1")}, - // Prefix: to.Ptr("2fff::/64"), - // }}, - // }, - // VlanID: to.Ptr[int32](755), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_Delete_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginDelete(ctx, "example-rg", "example-l3domain", "example-internalnetwork", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_ListByL3IsolationDomain_MaximumSet_Gen.json -func ExampleInternalNetworksClient_NewListByL3IsolationDomainPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInternalNetworksClient().NewListByL3IsolationDomainPager("example-rg", "example-l3domain", 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.InternalNetworksList = armmanagednetworkfabric.InternalNetworksList{ - // Value: []*armmanagednetworkfabric.InternalNetwork{ - // { - // Name: to.Ptr("example-internalnetwork"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3IsolationDomains/internalnetworks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-09T04:51:41.251Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.InternalNetworkProperties{ - // Annotation: to.Ptr("annotation"), - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // ConnectedIPv4Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // ConnectedIPv6Subnets: []*armmanagednetworkfabric.ConnectedSubnet{ - // { - // Annotation: to.Ptr("annotation"), - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicy{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // ImportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsMonitoringEnabled: to.Ptr(armmanagednetworkfabric.IsMonitoringEnabledTrue), - // Mtu: to.Ptr[int32](1500), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // BgpConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesBgpConfiguration{ - // Annotation: to.Ptr("annotation"), - // AllowAS: to.Ptr[int32](10), - // AllowASOverride: to.Ptr(armmanagednetworkfabric.AllowASOverrideEnable), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // DefaultRouteOriginate: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // FabricASN: to.Ptr[int64](20), - // IPv4ListenRangePrefixes: []*string{ - // to.Ptr("10.1.0.0/25")}, - // IPv4NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("10.1.0.0"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // IPv6ListenRangePrefixes: []*string{ - // to.Ptr("2fff::/66")}, - // IPv6NeighborAddress: []*armmanagednetworkfabric.NeighborAddress{ - // { - // Address: to.Ptr("2fff::"), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // }}, - // PeerASN: to.Ptr[int64](61234), - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // StaticRouteConfiguration: &armmanagednetworkfabric.InternalNetworkPropertiesStaticRouteConfiguration{ - // Extension: to.Ptr(armmanagednetworkfabric.ExtensionNoExtension), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](15), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("10.0.0.1")}, - // Prefix: to.Ptr("jffgck"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("3ffe::1")}, - // Prefix: to.Ptr("2fff::/64"), - // }}, - // }, - // VlanID: to.Ptr[int32](755), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalnetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateBgpAdministrativeState_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdateBgpAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateBgpAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalNetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternalNetworks_UpdateStaticRouteBfdAdministrativeState_MaximumSet_Gen.json -func ExampleInternalNetworksClient_BeginUpdateStaticRouteBfdAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternalNetworksClient().BeginUpdateStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-l3domain", "example-internalNetwork", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go index 6121be5961ee..be6cfcc86516 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *InternetGatewayRulesClient) BeginCreate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *InternetGatewayRulesClient) BeginCreate(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *InternetGatewayRulesClient) create(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRule, options *InternetGatewayRulesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *InternetGatewayRulesClient) createCreateRequest(ctx context.Contex reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements Internet Gateway Rules DELETE method. @@ -123,9 +128,10 @@ func (client *InternetGatewayRulesClient) BeginDelete(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *InternetGatewayRulesClient) BeginDelete(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *InternetGatewayRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,18 +190,21 @@ func (client *InternetGatewayRulesClient) deleteCreateRequest(ctx context.Contex // - options - InternetGatewayRulesClientGetOptions contains the optional parameters for the InternetGatewayRulesClient.Get // method. func (client *InternetGatewayRulesClient) Get(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, options *InternetGatewayRulesClientGetOptions) (InternetGatewayRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, options) if err != nil { return InternetGatewayRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InternetGatewayRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InternetGatewayRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InternetGatewayRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -362,9 +373,10 @@ func (client *InternetGatewayRulesClient) BeginUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewayRulesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewayRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -375,18 +387,20 @@ func (client *InternetGatewayRulesClient) BeginUpdate(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *InternetGatewayRulesClient) update(ctx context.Context, resourceGroupName string, internetGatewayRuleName string, body InternetGatewayRulePatch, options *InternetGatewayRulesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, internetGatewayRuleName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -409,5 +423,8 @@ func (client *InternetGatewayRulesClient) updateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go deleted file mode 100644 index 1f0e554cfcdc..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgatewayrules_client_example_test.go +++ /dev/null @@ -1,321 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Create_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewayRulesClient().BeginCreate(ctx, "example-rg", "example-internetGatewayRule", armmanagednetworkfabric.InternetGatewayRule{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - Annotation: to.Ptr("annotationValue"), - RuleProperties: &armmanagednetworkfabric.RuleProperties{ - Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - AddressList: []*string{ - to.Ptr("10.10.10.10")}, - }, - }, - }, 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.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ - // Name: to.Ptr("example-internetGatewayRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - // Annotation: to.Ptr("annotationValue"), - // InternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RuleProperties: &armmanagednetworkfabric.RuleProperties{ - // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - // AddressList: []*string{ - // to.Ptr("10.10.10.10")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Get_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInternetGatewayRulesClient().Get(ctx, "example-rg", "example-internetGatewayRule", 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.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ - // Name: to.Ptr("example-internetGatewayRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - // Annotation: to.Ptr("annotationValue"), - // InternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RuleProperties: &armmanagednetworkfabric.RuleProperties{ - // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - // AddressList: []*string{ - // to.Ptr("10.10.10.10")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Update_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewayRulesClient().BeginUpdate(ctx, "example-rg", "example-internetGatewayRule", armmanagednetworkfabric.InternetGatewayRulePatch{ - Tags: map[string]*string{ - "key3311": to.Ptr("1234"), - }, - }, 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.InternetGatewayRule = armmanagednetworkfabric.InternetGatewayRule{ - // Name: to.Ptr("example-internetGatewayRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3311": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - // Annotation: to.Ptr("annotationValue"), - // InternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RuleProperties: &armmanagednetworkfabric.RuleProperties{ - // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - // AddressList: []*string{ - // to.Ptr("10.10.10.10")}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_Delete_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewayRulesClient().BeginDelete(ctx, "example-rg", "example-internetGatewayRule", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListByResourceGroup_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInternetGatewayRulesClient().NewListByResourceGroupPager("example-internetGatewayRule", 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.InternetGatewayRulesListResult = armmanagednetworkfabric.InternetGatewayRulesListResult{ - // Value: []*armmanagednetworkfabric.InternetGatewayRule{ - // { - // Name: to.Ptr("example-internetGatewayRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - // Annotation: to.Ptr("annotationValue"), - // InternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RuleProperties: &armmanagednetworkfabric.RuleProperties{ - // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - // AddressList: []*string{ - // to.Ptr("10.10.10.10")}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGatewayRules_ListBySubscription_MaximumSet_Gen.json -func ExampleInternetGatewayRulesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInternetGatewayRulesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InternetGatewayRulesListResult = armmanagednetworkfabric.InternetGatewayRulesListResult{ - // Value: []*armmanagednetworkfabric.InternetGatewayRule{ - // { - // Name: to.Ptr("example-internetGatewayRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGatewayRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-InternetGatewayRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-24T18:22:51.443Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayRuleProperties{ - // Annotation: to.Ptr("annotationValue"), - // InternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RuleProperties: &armmanagednetworkfabric.RuleProperties{ - // Action: to.Ptr(armmanagednetworkfabric.ActionAllow), - // AddressList: []*string{ - // to.Ptr("10.10.10.10")}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go index 450aa624eb52..0e715207b4b3 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *InternetGatewaysClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewaysClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *InternetGatewaysClient) BeginCreate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternetGatewaysClient) create(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGateway, options *InternetGatewaysClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, internetGatewayName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *InternetGatewaysClient) createCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Execute a delete on Network Fabric Service Internet Gateway. @@ -123,9 +128,10 @@ func (client *InternetGatewaysClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *InternetGatewaysClient) BeginDelete(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternetGatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, internetGatewayName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *InternetGatewaysClient) deleteCreateRequest(ctx context.Context, r // - internetGatewayName - Name of the Internet Gateway. // - options - InternetGatewaysClientGetOptions contains the optional parameters for the InternetGatewaysClient.Get method. func (client *InternetGatewaysClient) Get(ctx context.Context, resourceGroupName string, internetGatewayName string, options *InternetGatewaysClientGetOptions) (InternetGatewaysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, internetGatewayName, options) if err != nil { return InternetGatewaysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InternetGatewaysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InternetGatewaysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InternetGatewaysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -361,9 +372,10 @@ func (client *InternetGatewaysClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[InternetGatewaysClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[InternetGatewaysClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,18 +386,20 @@ func (client *InternetGatewaysClient) BeginUpdate(ctx context.Context, resourceG // // Generated from API version 2023-06-15 func (client *InternetGatewaysClient) update(ctx context.Context, resourceGroupName string, internetGatewayName string, body InternetGatewayPatch, options *InternetGatewaysClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, internetGatewayName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -408,5 +422,8 @@ func (client *InternetGatewaysClient) updateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go deleted file mode 100644 index 315d0f3876a4..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/internetgateways_client_example_test.go +++ /dev/null @@ -1,312 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Create_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewaysClient().BeginCreate(ctx, "example-rg", "example-internetGateway", armmanagednetworkfabric.InternetGateway{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key3540": to.Ptr("1234"), - }, - Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - Annotation: to.Ptr("annotation"), - InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - }, - }, 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.InternetGateway = armmanagednetworkfabric.InternetGateway{ - // Name: to.Ptr("example-internetGateway"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3540": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - // Annotation: to.Ptr("annotation"), - // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - // IPv4Address: to.Ptr("10.10.10.10"), - // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - // Port: to.Ptr[int32](25), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Get_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInternetGatewaysClient().Get(ctx, "example-rg", "example-internetGateway", 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.InternetGateway = armmanagednetworkfabric.InternetGateway{ - // Name: to.Ptr("example-internetGateway"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3540": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - // Annotation: to.Ptr("annotation"), - // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - // IPv4Address: to.Ptr("10.10.10.10"), - // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - // Port: to.Ptr[int32](25), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Update_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewaysClient().BeginUpdate(ctx, "example-rg", "example-internetGateway", armmanagednetworkfabric.InternetGatewayPatch{ - Tags: map[string]*string{ - "key81": to.Ptr("2345"), - }, - Properties: &armmanagednetworkfabric.InternetGatewayPatchableProperties{ - InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - }, - }, 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.InternetGateway = armmanagednetworkfabric.InternetGateway{ - // Name: to.Ptr("example-internetGateway"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3540": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - // Annotation: to.Ptr("annotation"), - // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - // IPv4Address: to.Ptr("10.10.10.10"), - // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - // Port: to.Ptr[int32](25), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_Delete_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInternetGatewaysClient().BeginDelete(ctx, "example-rg", "example-internetGateway", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListByResourceGroup_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInternetGatewaysClient().NewListByResourceGroupPager("example-rg", 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.InternetGatewaysListResult = armmanagednetworkfabric.InternetGatewaysListResult{ - // Value: []*armmanagednetworkfabric.InternetGateway{ - // { - // Name: to.Ptr("example-internetGateway"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3540": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - // Annotation: to.Ptr("annotation"), - // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - // IPv4Address: to.Ptr("10.10.10.10"), - // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - // Port: to.Ptr[int32](25), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/InternetGateways_ListBySubscription_MaximumSet_Gen.json -func ExampleInternetGatewaysClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInternetGatewaysClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InternetGatewaysListResult = armmanagednetworkfabric.InternetGatewaysListResult{ - // Value: []*armmanagednetworkfabric.InternetGateway{ - // { - // Name: to.Ptr("example-internetGateway"), - // Type: to.Ptr("microsoft.managednetworkfabric/internetGateways"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T14:51:13.501Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key3540": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.InternetGatewayProperties{ - // Annotation: to.Ptr("annotation"), - // InternetGatewayRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/providers/Microsoft.ManagedNetworkFabric/internetGatewayRules/example-internetGatewayRule"), - // Type: to.Ptr(armmanagednetworkfabric.GatewayTypeInfrastructure), - // IPv4Address: to.Ptr("10.10.10.10"), - // NetworkFabricControllerID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkFabricController"), - // Port: to.Ptr[int32](25), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go index cedc55edf921..b579aec63566 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *IPCommunitiesClient) BeginCreate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPCommunitiesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *IPCommunitiesClient) BeginCreate(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *IPCommunitiesClient) create(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunity, options *IPCommunitiesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, ipCommunityName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *IPCommunitiesClient) createCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements IP Community DELETE method. @@ -123,9 +128,10 @@ func (client *IPCommunitiesClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPCommunitiesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *IPCommunitiesClient) BeginDelete(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *IPCommunitiesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipCommunityName string, options *IPCommunitiesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipCommunityName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *IPCommunitiesClient) deleteCreateRequest(ctx context.Context, reso // - ipCommunityName - Name of the IP Community. // - options - IPCommunitiesClientGetOptions contains the optional parameters for the IPCommunitiesClient.Get method. func (client *IPCommunitiesClient) Get(ctx context.Context, resourceGroupName string, ipCommunityName string, options *IPCommunitiesClientGetOptions) (IPCommunitiesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ipCommunityName, options) if err != nil { return IPCommunitiesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPCommunitiesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPCommunitiesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IPCommunitiesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -361,9 +372,10 @@ func (client *IPCommunitiesClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPCommunitiesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPCommunitiesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,18 +386,20 @@ func (client *IPCommunitiesClient) BeginUpdate(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *IPCommunitiesClient) update(ctx context.Context, resourceGroupName string, ipCommunityName string, body IPCommunityPatch, options *IPCommunitiesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, ipCommunityName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -408,5 +422,8 @@ func (client *IPCommunitiesClient) updateCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go deleted file mode 100644 index 66890a439c9c..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipcommunities_client_example_test.go +++ /dev/null @@ -1,353 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Create_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPCommunitiesClient().BeginCreate(ctx, "example-rg", "example-ipcommunity", armmanagednetworkfabric.IPCommunity{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyId": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.IPCommunityProperties{ - Annotation: to.Ptr("annotation"), - IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - CommunityMembers: []*string{ - to.Ptr("1:1")}, - SequenceNumber: to.Ptr[int64](4155123341), - WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - }}, - }, - }, 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.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipcommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyId": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1:1")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Get_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPCommunitiesClient().Get(ctx, "example-rg", "example-ipcommunity", 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.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipcommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyId": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1:1")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Update_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPCommunitiesClient().BeginUpdate(ctx, "example-rg", "example-ipcommunity", armmanagednetworkfabric.IPCommunityPatch{ - Properties: &armmanagednetworkfabric.IPCommunityPatchableProperties{ - IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - CommunityMembers: []*string{ - to.Ptr("1:1")}, - SequenceNumber: to.Ptr[int64](4155123341), - WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - }}, - }, - }, 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.IPCommunity = armmanagednetworkfabric.IPCommunity{ - // Name: to.Ptr("example-ipcommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1:1")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_Delete_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPCommunitiesClient().BeginDelete(ctx, "example-rg", "example-ipcommunity", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListByResourceGroup_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPCommunitiesClient().NewListByResourceGroupPager("example-rg", 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.IPCommunitiesListResult = armmanagednetworkfabric.IPCommunitiesListResult{ - // Value: []*armmanagednetworkfabric.IPCommunity{ - // { - // Name: to.Ptr("example-ipcommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyId": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1:1")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpCommunities_ListBySubscription_MaximumSet_Gen.json -func ExampleIPCommunitiesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPCommunitiesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPCommunitiesListResult = armmanagednetworkfabric.IPCommunitiesListResult{ - // Value: []*armmanagednetworkfabric.IPCommunity{ - // { - // Name: to.Ptr("example-ipcommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipcommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipcommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:26:17.611Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyId": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPCommunityRules: []*armmanagednetworkfabric.IPCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // CommunityMembers: []*string{ - // to.Ptr("1:1")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // WellKnownCommunities: []*armmanagednetworkfabric.WellKnownCommunities{ - // to.Ptr(armmanagednetworkfabric.WellKnownCommunitiesInternet)}, - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go index c85e8b13eb41..5edb0d7948b0 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *IPExtendedCommunitiesClient) BeginCreate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPExtendedCommunitiesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *IPExtendedCommunitiesClient) BeginCreate(ctx context.Context, reso // // Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) create(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunity, options *IPExtendedCommunitiesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *IPExtendedCommunitiesClient) createCreateRequest(ctx context.Conte reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements IP Extended Community DELETE method. @@ -123,9 +128,10 @@ func (client *IPExtendedCommunitiesClient) BeginDelete(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPExtendedCommunitiesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *IPExtendedCommunitiesClient) BeginDelete(ctx context.Context, reso // // Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,18 +190,21 @@ func (client *IPExtendedCommunitiesClient) deleteCreateRequest(ctx context.Conte // - options - IPExtendedCommunitiesClientGetOptions contains the optional parameters for the IPExtendedCommunitiesClient.Get // method. func (client *IPExtendedCommunitiesClient) Get(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, options *IPExtendedCommunitiesClientGetOptions) (IPExtendedCommunitiesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, options) if err != nil { return IPExtendedCommunitiesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPExtendedCommunitiesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPExtendedCommunitiesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IPExtendedCommunitiesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -362,9 +373,10 @@ func (client *IPExtendedCommunitiesClient) BeginUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPExtendedCommunitiesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPExtendedCommunitiesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -375,18 +387,20 @@ func (client *IPExtendedCommunitiesClient) BeginUpdate(ctx context.Context, reso // // Generated from API version 2023-06-15 func (client *IPExtendedCommunitiesClient) update(ctx context.Context, resourceGroupName string, ipExtendedCommunityName string, body IPExtendedCommunityPatch, options *IPExtendedCommunitiesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, ipExtendedCommunityName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -409,5 +423,8 @@ func (client *IPExtendedCommunitiesClient) updateCreateRequest(ctx context.Conte reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go deleted file mode 100644 index eb83bd0fa5b3..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipextendedcommunities_client_example_test.go +++ /dev/null @@ -1,342 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Create_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginCreate(ctx, "example-rg", "example-ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunity{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - Annotation: to.Ptr("annotation"), - IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - RouteTargets: []*string{ - to.Ptr("1234:2345")}, - SequenceNumber: to.Ptr[int64](4155123341), - }}, - }, - }, 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.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example-ipExtendedCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // RouteTargets: []*string{ - // to.Ptr("1234:2345")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Get_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPExtendedCommunitiesClient().Get(ctx, "example-rg", "example-ipExtendedCommunity", 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.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example-ipExtendedCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // RouteTargets: []*string{ - // to.Ptr("1234:2345")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Update_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginUpdate(ctx, "example-rg", "example-ipExtendedCommunity", armmanagednetworkfabric.IPExtendedCommunityPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.IPExtendedCommunityPatchProperties{ - IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - RouteTargets: []*string{ - to.Ptr("1234:2345")}, - SequenceNumber: to.Ptr[int64](4155123341), - }}, - }, - }, 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.IPExtendedCommunity = armmanagednetworkfabric.IPExtendedCommunity{ - // Name: to.Ptr("example-ipExtendedCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // RouteTargets: []*string{ - // to.Ptr("1234:2345")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_Delete_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPExtendedCommunitiesClient().BeginDelete(ctx, "example-rg", "example-ipExtendedCommunity", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListByResourceGroup_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPExtendedCommunitiesClient().NewListByResourceGroupPager("example-rg", 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.IPExtendedCommunityListResult = armmanagednetworkfabric.IPExtendedCommunityListResult{ - // Value: []*armmanagednetworkfabric.IPExtendedCommunity{ - // { - // Name: to.Ptr("example-ipExtendedCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // RouteTargets: []*string{ - // to.Ptr("1234:2345")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpExtendedCommunities_ListBySubscription_MaximumSet_Gen.json -func ExampleIPExtendedCommunitiesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPExtendedCommunitiesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPExtendedCommunityListResult = armmanagednetworkfabric.IPExtendedCommunityListResult{ - // Value: []*armmanagednetworkfabric.IPExtendedCommunity{ - // { - // Name: to.Ptr("example-ipExtendedCommunity"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipExtendedCommunities"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T18:49:33.904Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPExtendedCommunityProperties{ - // Annotation: to.Ptr("annotation"), - // IPExtendedCommunityRules: []*armmanagednetworkfabric.IPExtendedCommunityRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // RouteTargets: []*string{ - // to.Ptr("1234:2345")}, - // SequenceNumber: to.Ptr[int64](4155123341), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go index 1803e80f9091..39e2c9af3172 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *IPPrefixesClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPPrefixesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *IPPrefixesClient) BeginCreate(ctx context.Context, resourceGroupNa // // Generated from API version 2023-06-15 func (client *IPPrefixesClient) create(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefix, options *IPPrefixesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, ipPrefixName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -105,7 +107,10 @@ func (client *IPPrefixesClient) createCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements IP Prefix DELETE method. @@ -121,9 +126,10 @@ func (client *IPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPPrefixesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,18 +140,20 @@ func (client *IPPrefixesClient) BeginDelete(ctx context.Context, resourceGroupNa // // Generated from API version 2023-06-15 func (client *IPPrefixesClient) deleteOperation(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, ipPrefixName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,18 +187,21 @@ func (client *IPPrefixesClient) deleteCreateRequest(ctx context.Context, resourc // - ipPrefixName - Name of the IP Prefix. // - options - IPPrefixesClientGetOptions contains the optional parameters for the IPPrefixesClient.Get method. func (client *IPPrefixesClient) Get(ctx context.Context, resourceGroupName string, ipPrefixName string, options *IPPrefixesClientGetOptions) (IPPrefixesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ipPrefixName, options) if err != nil { return IPPrefixesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IPPrefixesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IPPrefixesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IPPrefixesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -358,9 +369,10 @@ func (client *IPPrefixesClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[IPPrefixesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[IPPrefixesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -371,18 +383,20 @@ func (client *IPPrefixesClient) BeginUpdate(ctx context.Context, resourceGroupNa // // Generated from API version 2023-06-15 func (client *IPPrefixesClient) update(ctx context.Context, resourceGroupName string, ipPrefixName string, body IPPrefixPatch, options *IPPrefixesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, ipPrefixName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -405,5 +419,8 @@ func (client *IPPrefixesClient) updateCreateRequest(ctx context.Context, resourc reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go deleted file mode 100644 index f2664fe33ae7..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/ipprefixes_client_example_test.go +++ /dev/null @@ -1,350 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Create_MaximumSet_Gen.json -func ExampleIPPrefixesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPPrefixesClient().BeginCreate(ctx, "example-rg", "example-ipPrefix", armmanagednetworkfabric.IPPrefix{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.IPPrefixProperties{ - Annotation: to.Ptr("annotation"), - IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - NetworkPrefix: to.Ptr("10.10.10.10/30"), - SequenceNumber: to.Ptr[int64](4155123341), - SubnetMaskLength: to.Ptr("10"), - }}, - }, - }, 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.IPPrefix = armmanagednetworkfabric.IPPrefix{ - // Name: to.Ptr("example-ipPrefix"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotation"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - // NetworkPrefix: to.Ptr("10.10.10.10/30"), - // SequenceNumber: to.Ptr[int64](4155123341), - // SubnetMaskLength: to.Ptr("10"), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Get_MaximumSet_Gen.json -func ExampleIPPrefixesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIPPrefixesClient().Get(ctx, "example-rg", "example-ipPrefix", 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.IPPrefix = armmanagednetworkfabric.IPPrefix{ - // Name: to.Ptr("example-ipPrefix"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotation"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - // NetworkPrefix: to.Ptr("10.10.10.10/30"), - // SequenceNumber: to.Ptr[int64](4155123341), - // SubnetMaskLength: to.Ptr("10"), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Update_MaximumSet_Gen.json -func ExampleIPPrefixesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPPrefixesClient().BeginUpdate(ctx, "example-rg", "example-ipPrefix", armmanagednetworkfabric.IPPrefixPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.IPPrefixPatchProperties{ - Annotation: to.Ptr("annotation"), - IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - { - Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - NetworkPrefix: to.Ptr("10.10.10.10/30"), - SequenceNumber: to.Ptr[int64](4155123341), - SubnetMaskLength: to.Ptr("10"), - }}, - }, - }, 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.IPPrefix = armmanagednetworkfabric.IPPrefix{ - // Name: to.Ptr("example-ipPrefix"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotation"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - // NetworkPrefix: to.Ptr("10.10.10.10/30"), - // SequenceNumber: to.Ptr[int64](4155123341), - // SubnetMaskLength: to.Ptr("10"), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_Delete_MaximumSet_Gen.json -func ExampleIPPrefixesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIPPrefixesClient().BeginDelete(ctx, "example-rg", "example-ipPrefix", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListByResourceGroup_MaximumSet_Gen.json -func ExampleIPPrefixesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPPrefixesClient().NewListByResourceGroupPager("example-rg", 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.IPPrefixesListResult = armmanagednetworkfabric.IPPrefixesListResult{ - // Value: []*armmanagednetworkfabric.IPPrefix{ - // { - // Name: to.Ptr("example-ipPrefix"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotation"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - // NetworkPrefix: to.Ptr("10.10.10.10/30"), - // SequenceNumber: to.Ptr[int64](4155123341), - // SubnetMaskLength: to.Ptr("10"), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/IpPrefixes_ListBySubscription_MaximumSet_Gen.json -func ExampleIPPrefixesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIPPrefixesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IPPrefixesListResult = armmanagednetworkfabric.IPPrefixesListResult{ - // Value: []*armmanagednetworkfabric.IPPrefix{ - // { - // Name: to.Ptr("example-ipPrefix"), - // Type: to.Ptr("microsoft.managednetworkfabric/ipPrefixes"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.656Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T03:52:05.657Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.IPPrefixProperties{ - // Annotation: to.Ptr("annotation"), - // IPPrefixRules: []*armmanagednetworkfabric.IPPrefixRule{ - // { - // Action: to.Ptr(armmanagednetworkfabric.CommunityActionTypesPermit), - // Condition: to.Ptr(armmanagednetworkfabric.ConditionGreaterThanOrEqualTo), - // NetworkPrefix: to.Ptr("10.10.10.10/30"), - // SequenceNumber: to.Ptr[int64](4155123341), - // SubnetMaskLength: to.Ptr("10"), - // }}, - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go index 4e577ea89b5f..421ad8655c16 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *L2IsolationDomainsClient) BeginCommitConfiguration(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientCommitConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *L2IsolationDomainsClient) BeginCommitConfiguration(ctx context.Con // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) commitConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginCommitConfigurationOptions) (*http.Response, error) { + var err error req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitConfigurationCreateRequest creates the CommitConfiguration request. @@ -124,9 +126,10 @@ func (client *L2IsolationDomainsClient) BeginCreate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -138,18 +141,20 @@ func (client *L2IsolationDomainsClient) BeginCreate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) create(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomain, options *L2IsolationDomainsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -172,7 +177,10 @@ func (client *L2IsolationDomainsClient) createCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes layer 2 connectivity between compute nodes by managed by named L2 Isolation name. @@ -189,9 +197,10 @@ func (client *L2IsolationDomainsClient) BeginDelete(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -202,18 +211,20 @@ func (client *L2IsolationDomainsClient) BeginDelete(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -247,18 +258,21 @@ func (client *L2IsolationDomainsClient) deleteCreateRequest(ctx context.Context, // - l2IsolationDomainName - Name of the L2 Isolation Domain. // - options - L2IsolationDomainsClientGetOptions contains the optional parameters for the L2IsolationDomainsClient.Get method. func (client *L2IsolationDomainsClient) Get(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientGetOptions) (L2IsolationDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, options) if err != nil { return L2IsolationDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return L2IsolationDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return L2IsolationDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return L2IsolationDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -427,9 +441,10 @@ func (client *L2IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -440,18 +455,20 @@ func (client *L2IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) update(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body L2IsolationDomainPatch, options *L2IsolationDomainsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -474,7 +491,10 @@ func (client *L2IsolationDomainsClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Enables isolation domain across the fabric or on specified racks. @@ -492,9 +512,10 @@ func (client *L2IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -505,18 +526,20 @@ func (client *L2IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, body UpdateAdministrativeState, options *L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -539,7 +562,10 @@ func (client *L2IsolationDomainsClient) updateAdministrativeStateCreateRequest(c reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Validates the configuration of the resources. @@ -556,9 +582,10 @@ func (client *L2IsolationDomainsClient) BeginValidateConfiguration(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L2IsolationDomainsClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L2IsolationDomainsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -569,18 +596,20 @@ func (client *L2IsolationDomainsClient) BeginValidateConfiguration(ctx context.C // // Generated from API version 2023-06-15 func (client *L2IsolationDomainsClient) validateConfiguration(ctx context.Context, resourceGroupName string, l2IsolationDomainName string, options *L2IsolationDomainsClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, l2IsolationDomainName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go deleted file mode 100644 index 76a789c5e225..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l2isolationdomains_client_example_test.go +++ /dev/null @@ -1,442 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Create_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginCreate(ctx, "example-rg", "example-l2domain", armmanagednetworkfabric.L2IsolationDomain{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - Annotation: to.Ptr("annotation"), - Mtu: to.Ptr[int32](1500), - NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - VlanID: to.Ptr[int32](501), - }, - }, 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.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("example-l2domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Get_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewL2IsolationDomainsClient().Get(ctx, "example-rg", "example-l2Domain", 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.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("example-l2domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Update_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdate(ctx, "example-rg", "example-l2Domain", armmanagednetworkfabric.L2IsolationDomainPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.L2IsolationDomainPatchProperties{ - Annotation: to.Ptr("annotation1"), - Mtu: to.Ptr[int32](6000), - }, - }, 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.L2IsolationDomain = armmanagednetworkfabric.L2IsolationDomain{ - // Name: to.Ptr("example-l2domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("annotation1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_Delete_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginDelete(ctx, "example-rg", "example-l2Domain", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l2Domain", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginValidateConfiguration(ctx, "example-rg", "example-l2domain", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_CommitConfiguration_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_BeginCommitConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL2IsolationDomainsClient().BeginCommitConfiguration(ctx, "example-rg", "example-l2domain", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewL2IsolationDomainsClient().NewListByResourceGroupPager("example-rg", 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.L2IsolationDomainsListResult = armmanagednetworkfabric.L2IsolationDomainsListResult{ - // Value: []*armmanagednetworkfabric.L2IsolationDomain{ - // { - // Name: to.Ptr("example-l2domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L2IsolationDomains_ListBySubscription_MaximumSet_Gen.json -func ExampleL2IsolationDomainsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewL2IsolationDomainsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.L2IsolationDomainsListResult = armmanagednetworkfabric.L2IsolationDomainsListResult{ - // Value: []*armmanagednetworkfabric.L2IsolationDomain{ - // { - // Name: to.Ptr("example-l2domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l2IsolationDomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.977Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T17:42:03.978Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.L2IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Mtu: to.Ptr[int32](1500), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // VlanID: to.Ptr[int32](501), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go index 04deb3e7a893..d01b71cf2edd 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *L3IsolationDomainsClient) BeginCommitConfiguration(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientCommitConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *L3IsolationDomainsClient) BeginCommitConfiguration(ctx context.Con // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) commitConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginCommitConfigurationOptions) (*http.Response, error) { + var err error req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitConfigurationCreateRequest creates the CommitConfiguration request. @@ -125,9 +127,10 @@ func (client *L3IsolationDomainsClient) BeginCreate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -140,18 +143,20 @@ func (client *L3IsolationDomainsClient) BeginCreate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) create(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomain, options *L3IsolationDomainsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -174,7 +179,10 @@ func (client *L3IsolationDomainsClient) createCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes layer 3 connectivity between compute nodes by managed by named L3 Isolation name. @@ -191,9 +199,10 @@ func (client *L3IsolationDomainsClient) BeginDelete(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -204,18 +213,20 @@ func (client *L3IsolationDomainsClient) BeginDelete(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -249,18 +260,21 @@ func (client *L3IsolationDomainsClient) deleteCreateRequest(ctx context.Context, // - l3IsolationDomainName - Name of the L3 Isolation Domain. // - options - L3IsolationDomainsClientGetOptions contains the optional parameters for the L3IsolationDomainsClient.Get method. func (client *L3IsolationDomainsClient) Get(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientGetOptions) (L3IsolationDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, options) if err != nil { return L3IsolationDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return L3IsolationDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return L3IsolationDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return L3IsolationDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -429,9 +443,10 @@ func (client *L3IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -442,18 +457,20 @@ func (client *L3IsolationDomainsClient) BeginUpdate(ctx context.Context, resourc // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) update(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body L3IsolationDomainPatch, options *L3IsolationDomainsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -476,7 +493,10 @@ func (client *L3IsolationDomainsClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Enables racks for this Isolation Domain. @@ -494,9 +514,10 @@ func (client *L3IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -507,18 +528,20 @@ func (client *L3IsolationDomainsClient) BeginUpdateAdministrativeState(ctx conte // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, body UpdateAdministrativeState, options *L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -541,7 +564,10 @@ func (client *L3IsolationDomainsClient) updateAdministrativeStateCreateRequest(c reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Validates the configuration of the resources. @@ -558,9 +584,10 @@ func (client *L3IsolationDomainsClient) BeginValidateConfiguration(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[L3IsolationDomainsClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[L3IsolationDomainsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -571,18 +598,20 @@ func (client *L3IsolationDomainsClient) BeginValidateConfiguration(ctx context.C // // Generated from API version 2023-06-15 func (client *L3IsolationDomainsClient) validateConfiguration(ctx context.Context, resourceGroupName string, l3IsolationDomainName string, options *L3IsolationDomainsClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, l3IsolationDomainName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go deleted file mode 100644 index c419be63d524..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/l3isolationdomains_client_example_test.go +++ /dev/null @@ -1,562 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Create_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginCreate(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.L3IsolationDomain{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - Annotation: to.Ptr("annotation"), - AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - { - Prefix: to.Ptr("10.0.0.0/24"), - }}, - IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - { - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - }, - ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - }, - }, 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.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ - // Name: to.Ptr("example-l3domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Get_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewL3IsolationDomainsClient().Get(ctx, "example-rg", "example-l3domain", 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.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ - // Name: to.Ptr("example-l3domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Update_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdate(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.L3IsolationDomainPatch{ - Tags: map[string]*string{ - "key4953": to.Ptr("1234"), - }, - Properties: &armmanagednetworkfabric.L3IsolationDomainPatchProperties{ - Annotation: to.Ptr("annotation1"), - AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - { - Prefix: to.Ptr("10.0.0.0/24"), - }}, - IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - { - Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - }}, - }, - ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - }, - ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - }, - RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - }, - }, 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.L3IsolationDomain = armmanagednetworkfabric.L3IsolationDomain{ - // Name: to.Ptr("example-l3domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key4953": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_Delete_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginDelete(ctx, "example-rg", "example-l3domain", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListByResourceGroup_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewL3IsolationDomainsClient().NewListByResourceGroupPager("example-rg", 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.L3IsolationDomainsListResult = armmanagednetworkfabric.L3IsolationDomainsListResult{ - // Value: []*armmanagednetworkfabric.L3IsolationDomain{ - // { - // Name: to.Ptr("example-l3domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ListBySubscription_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewL3IsolationDomainsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.L3IsolationDomainsListResult = armmanagednetworkfabric.L3IsolationDomainsListResult{ - // Value: []*armmanagednetworkfabric.L3IsolationDomain{ - // { - // Name: to.Ptr("example-l3domain"), - // Type: to.Ptr("microsoft.managednetworkfabric/l3isolationdomains"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-05T18:37:10.310Z"); return t}()), - // LastModifiedBy: to.Ptr("UserId"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.L3IsolationDomainProperties{ - // Annotation: to.Ptr("annotation"), - // AggregateRouteConfiguration: &armmanagednetworkfabric.AggregateRouteConfiguration{ - // IPv4Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("10.0.0.0/24"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.AggregateRoute{ - // { - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::a0/29"), - // }}, - // }, - // ConnectedSubnetRoutePolicy: &armmanagednetworkfabric.ConnectedSubnetRoutePolicy{ - // ExportRoutePolicy: &armmanagednetworkfabric.L3ExportRoutePolicy{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ExportRoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName"), - // }, - // RedistributeConnectedSubnets: to.Ptr(armmanagednetworkfabric.RedistributeConnectedSubnetsTrue), - // RedistributeStaticRoutes: to.Ptr(armmanagednetworkfabric.RedistributeStaticRoutesFalse), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_updateAdministrativeState_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-l3domain", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_ValidateConfiguration_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginValidateConfiguration(ctx, "example-rg", "example-l3domain", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/L3IsolationDomains_CommitConfiguration_MaximumSet_Gen.json -func ExampleL3IsolationDomainsClient_BeginCommitConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewL3IsolationDomainsClient().BeginCommitConfiguration(ctx, "example-rg", "example-l3domain", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go index 8f244ef7785e..bc72fa136dd4 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/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 armmanagednetworkfabric @@ -46,19 +45,19 @@ type AccessControlListAction struct { // AccessControlListMatchCondition - Defines the match condition that is supported to filter the traffic. type AccessControlListMatchCondition struct { - // List of DSCP Markings that needs to be matched. + // List of DSCP Markings that need to be matched. DscpMarkings []*string - // List of ether type values that needs to be matched. + // List of ether type values that need to be matched. EtherTypes []*string - // List of IP fragment packets that needs to be matched. + // List of IP fragment packets that need to be matched. Fragments []*string // IP condition that needs to be matched. IPCondition *IPMatchCondition - // List of IP Lengths that needs to be matched. + // List of IP Lengths that need to be matched. IPLengths []*string // Defines the port condition that needs to be matched. @@ -67,7 +66,7 @@ type AccessControlListMatchCondition struct { // List of the protocols that need to be matched. ProtocolTypes []*string - // List of TTL [Time To Live] values that needs to be matched. + // List of TTL [Time To Live] values that need to be matched. TTLValues []*string // Vlan match condition that needs to be matched. @@ -112,6 +111,9 @@ type AccessControlListPatchProperties struct { // Input method to configure Access Control List. ConfigurationType *ConfigurationType + // Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + DefaultAction *CommunityActionTypes + // List of dynamic match configurations. DynamicMatchConfigurations []*CommonDynamicMatchConfiguration @@ -124,10 +126,11 @@ type AccessControlListPortCondition struct { // REQUIRED; Layer4 protocol type that needs to be matched. Layer4Protocol *Layer4Protocol - // List of protocol flags that needs to be matched. + // List of protocol flags that need to be matched. Example: established | initial | . List of eligible TCP Flags are ack, + // fin, not-ack, not-fin, not-psh, not-rst, not-syn, not-urg, psh, rst, syn, urg Flags []*string - // List of the port Group Names that to be matched. + // List of the port Group Names that need to be matched. PortGroupNames []*string // Port type that needs to be matched. @@ -148,6 +151,9 @@ type AccessControlListProperties struct { // Input method to configure Access Control List. ConfigurationType *ConfigurationType + // Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + DefaultAction *CommunityActionTypes + // List of dynamic match configurations. DynamicMatchConfigurations []*CommonDynamicMatchConfiguration @@ -167,65 +173,6 @@ type AccessControlListProperties struct { ProvisioningState *ProvisioningState } -// AccessControlListsClientBeginCreateOptions contains the optional parameters for the AccessControlListsClient.BeginCreate -// method. -type AccessControlListsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientBeginDeleteOptions contains the optional parameters for the AccessControlListsClient.BeginDelete -// method. -type AccessControlListsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientBeginResyncOptions contains the optional parameters for the AccessControlListsClient.BeginResync -// method. -type AccessControlListsClientBeginResyncOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdateAdministrativeState -// method. -type AccessControlListsClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientBeginUpdateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdate -// method. -type AccessControlListsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientBeginValidateConfigurationOptions contains the optional parameters for the AccessControlListsClient.BeginValidateConfiguration -// method. -type AccessControlListsClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccessControlListsClientGetOptions contains the optional parameters for the AccessControlListsClient.Get method. -type AccessControlListsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AccessControlListsClientListByResourceGroupOptions contains the optional parameters for the AccessControlListsClient.NewListByResourceGroupPager -// method. -type AccessControlListsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AccessControlListsClientListBySubscriptionOptions contains the optional parameters for the AccessControlListsClient.NewListBySubscriptionPager -// method. -type AccessControlListsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // AccessControlListsListResult - List of Access Control Lists. type AccessControlListsListResult struct { // Url to follow for getting next page of resources. @@ -328,7 +275,7 @@ type CommonDynamicMatchConfiguration struct { // List of IP Groups. IPGroups []*IPGroupProperties - // List of the port group. + // List of the port groups. PortGroups []*PortGroupProperties // List of vlan groups. @@ -618,49 +565,6 @@ type ExternalNetworkPropertiesOptionAProperties struct { FabricASN *int64 } -// ExternalNetworksClientBeginCreateOptions contains the optional parameters for the ExternalNetworksClient.BeginCreate method. -type ExternalNetworksClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginDeleteOptions contains the optional parameters for the ExternalNetworksClient.BeginDelete method. -type ExternalNetworksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateAdministrativeState -// method. -type ExternalNetworksClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginUpdateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdate method. -type ExternalNetworksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState -// method. -type ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExternalNetworksClientGetOptions contains the optional parameters for the ExternalNetworksClient.Get method. -type ExternalNetworksClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the ExternalNetworksClient.NewListByL3IsolationDomainPager -// method. -type ExternalNetworksClientListByL3IsolationDomainOptions struct { - // placeholder for future optional parameters -} - // ExternalNetworksList - List of External Networks. type ExternalNetworksList struct { // Url to follow for getting next page of resources. @@ -670,41 +574,6 @@ type ExternalNetworksList struct { Value []*ExternalNetwork } -// IPCommunitiesClientBeginCreateOptions contains the optional parameters for the IPCommunitiesClient.BeginCreate method. -type IPCommunitiesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPCommunitiesClient.BeginDelete method. -type IPCommunitiesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPCommunitiesClient.BeginUpdate method. -type IPCommunitiesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPCommunitiesClientGetOptions contains the optional parameters for the IPCommunitiesClient.Get method. -type IPCommunitiesClientGetOptions struct { - // placeholder for future optional parameters -} - -// IPCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPCommunitiesClient.NewListByResourceGroupPager -// method. -type IPCommunitiesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// IPCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPCommunitiesClient.NewListBySubscriptionPager -// method. -type IPCommunitiesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // IPCommunitiesListResult - List of IP Communities. type IPCommunitiesListResult struct { // Url to follow for getting next page of resources. @@ -794,44 +663,6 @@ type IPCommunityRule struct { WellKnownCommunities []*WellKnownCommunities } -// IPExtendedCommunitiesClientBeginCreateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginCreate -// method. -type IPExtendedCommunitiesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPExtendedCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginDelete -// method. -type IPExtendedCommunitiesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPExtendedCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginUpdate -// method. -type IPExtendedCommunitiesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPExtendedCommunitiesClientGetOptions contains the optional parameters for the IPExtendedCommunitiesClient.Get method. -type IPExtendedCommunitiesClientGetOptions struct { - // placeholder for future optional parameters -} - -// IPExtendedCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListByResourceGroupPager -// method. -type IPExtendedCommunitiesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// IPExtendedCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListBySubscriptionPager -// method. -type IPExtendedCommunitiesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // IPExtendedCommunity - The IP Extended Community resource definition. type IPExtendedCommunity struct { // REQUIRED; The geo-location where the resource lives @@ -940,13 +771,13 @@ type IPMatchCondition struct { // The List of IP Group Names that need to be matched. IPGroupNames []*string - // The list of IP Prefixes. + // The list of IP Prefixes that need to be matched. IPPrefixValues []*string - // IP Prefix Type. + // IP Prefix Type that needs to be matched. PrefixType *PrefixType - // IP Address type. + // IP Address type that needs to be matched. Type *SourceDestinationType } @@ -1031,41 +862,6 @@ type IPPrefixRule struct { SubnetMaskLength *string } -// IPPrefixesClientBeginCreateOptions contains the optional parameters for the IPPrefixesClient.BeginCreate method. -type IPPrefixesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPPrefixesClientBeginDeleteOptions contains the optional parameters for the IPPrefixesClient.BeginDelete method. -type IPPrefixesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPPrefixesClientBeginUpdateOptions contains the optional parameters for the IPPrefixesClient.BeginUpdate method. -type IPPrefixesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IPPrefixesClientGetOptions contains the optional parameters for the IPPrefixesClient.Get method. -type IPPrefixesClientGetOptions struct { - // placeholder for future optional parameters -} - -// IPPrefixesClientListByResourceGroupOptions contains the optional parameters for the IPPrefixesClient.NewListByResourceGroupPager -// method. -type IPPrefixesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// IPPrefixesClientListBySubscriptionOptions contains the optional parameters for the IPPrefixesClient.NewListBySubscriptionPager -// method. -type IPPrefixesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // IPPrefixesListResult - List of IP Prefixes. type IPPrefixesListResult struct { // Url to follow for getting next page of resources. @@ -1268,56 +1064,6 @@ type InternalNetworkPropertiesStaticRouteConfiguration struct { IPv6Routes []*StaticRouteProperties } -// InternalNetworksClientBeginCreateOptions contains the optional parameters for the InternalNetworksClient.BeginCreate method. -type InternalNetworksClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientBeginDeleteOptions contains the optional parameters for the InternalNetworksClient.BeginDelete method. -type InternalNetworksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateAdministrativeState -// method. -type InternalNetworksClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState -// method. -type InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientBeginUpdateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdate method. -type InternalNetworksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState -// method. -type InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. -type InternalNetworksClientGetOptions struct { - // placeholder for future optional parameters -} - -// InternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the InternalNetworksClient.NewListByL3IsolationDomainPager -// method. -type InternalNetworksClientListByL3IsolationDomainOptions struct { - // placeholder for future optional parameters -} - // InternalNetworksList - List of Internal Networks. type InternalNetworksList struct { // Url to follow for getting next page of resources. @@ -1435,44 +1181,6 @@ type InternetGatewayRuleProperties struct { ProvisioningState *ProvisioningState } -// InternetGatewayRulesClientBeginCreateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginCreate -// method. -type InternetGatewayRulesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewayRulesClientBeginDeleteOptions contains the optional parameters for the InternetGatewayRulesClient.BeginDelete -// method. -type InternetGatewayRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewayRulesClientBeginUpdateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginUpdate -// method. -type InternetGatewayRulesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewayRulesClientGetOptions contains the optional parameters for the InternetGatewayRulesClient.Get method. -type InternetGatewayRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// InternetGatewayRulesClientListByResourceGroupOptions contains the optional parameters for the InternetGatewayRulesClient.NewListByResourceGroupPager -// method. -type InternetGatewayRulesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// InternetGatewayRulesClientListBySubscriptionOptions contains the optional parameters for the InternetGatewayRulesClient.NewListBySubscriptionPager -// method. -type InternetGatewayRulesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // InternetGatewayRulesListResult - List of Internet Gateway Rules. type InternetGatewayRulesListResult struct { // Url to follow for getting next page of resources. @@ -1482,41 +1190,6 @@ type InternetGatewayRulesListResult struct { Value []*InternetGatewayRule } -// InternetGatewaysClientBeginCreateOptions contains the optional parameters for the InternetGatewaysClient.BeginCreate method. -type InternetGatewaysClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewaysClientBeginDeleteOptions contains the optional parameters for the InternetGatewaysClient.BeginDelete method. -type InternetGatewaysClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewaysClientBeginUpdateOptions contains the optional parameters for the InternetGatewaysClient.BeginUpdate method. -type InternetGatewaysClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// InternetGatewaysClientGetOptions contains the optional parameters for the InternetGatewaysClient.Get method. -type InternetGatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// InternetGatewaysClientListByResourceGroupOptions contains the optional parameters for the InternetGatewaysClient.NewListByResourceGroupPager -// method. -type InternetGatewaysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// InternetGatewaysClientListBySubscriptionOptions contains the optional parameters for the InternetGatewaysClient.NewListBySubscriptionPager -// method. -type InternetGatewaysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // InternetGatewaysListResult - List of InternetGateways. type InternetGatewaysListResult struct { // Url to follow for getting next page of resources. @@ -1601,65 +1274,6 @@ type L2IsolationDomainProperties struct { ProvisioningState *ProvisioningState } -// L2IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCommitConfiguration -// method. -type L2IsolationDomainsClientBeginCommitConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCreate -// method. -type L2IsolationDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L2IsolationDomainsClient.BeginDelete -// method. -type L2IsolationDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdateAdministrativeState -// method. -type L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdate -// method. -type L2IsolationDomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginValidateConfiguration -// method. -type L2IsolationDomainsClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L2IsolationDomainsClientGetOptions contains the optional parameters for the L2IsolationDomainsClient.Get method. -type L2IsolationDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// L2IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L2IsolationDomainsClient.NewListByResourceGroupPager -// method. -type L2IsolationDomainsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// L2IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L2IsolationDomainsClient.NewListBySubscriptionPager -// method. -type L2IsolationDomainsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // L2IsolationDomainsListResult - List of L2 Isolation Domains. type L2IsolationDomainsListResult struct { // Url to follow for getting next page of resources. @@ -1759,65 +1373,6 @@ type L3IsolationDomainProperties struct { ProvisioningState *ProvisioningState } -// L3IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCommitConfiguration -// method. -type L3IsolationDomainsClientBeginCommitConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCreate -// method. -type L3IsolationDomainsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L3IsolationDomainsClient.BeginDelete -// method. -type L3IsolationDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdateAdministrativeState -// method. -type L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdate -// method. -type L3IsolationDomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginValidateConfiguration -// method. -type L3IsolationDomainsClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// L3IsolationDomainsClientGetOptions contains the optional parameters for the L3IsolationDomainsClient.Get method. -type L3IsolationDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// L3IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L3IsolationDomainsClient.NewListByResourceGroupPager -// method. -type L3IsolationDomainsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// L3IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L3IsolationDomainsClient.NewListBySubscriptionPager -// method. -type L3IsolationDomainsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // L3IsolationDomainsListResult - List of L3 Isolation Domains. type L3IsolationDomainsListResult struct { // Url to follow for getting next page of resources. @@ -1953,41 +1508,6 @@ type NeighborGroupProperties struct { ProvisioningState *ProvisioningState } -// NeighborGroupsClientBeginCreateOptions contains the optional parameters for the NeighborGroupsClient.BeginCreate method. -type NeighborGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NeighborGroupsClientBeginDeleteOptions contains the optional parameters for the NeighborGroupsClient.BeginDelete method. -type NeighborGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NeighborGroupsClientBeginUpdateOptions contains the optional parameters for the NeighborGroupsClient.BeginUpdate method. -type NeighborGroupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NeighborGroupsClientGetOptions contains the optional parameters for the NeighborGroupsClient.Get method. -type NeighborGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NeighborGroupsClientListByResourceGroupOptions contains the optional parameters for the NeighborGroupsClient.NewListByResourceGroupPager -// method. -type NeighborGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NeighborGroupsClientListBySubscriptionOptions contains the optional parameters for the NeighborGroupsClient.NewListBySubscriptionPager -// method. -type NeighborGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NeighborGroupsListResult - List of Neighbor Group. type NeighborGroupsListResult struct { // Url to follow for getting next page of resources. @@ -2120,17 +1640,6 @@ type NetworkDeviceSKUProperties struct { ProvisioningState *ProvisioningState } -// NetworkDeviceSKUsClientGetOptions contains the optional parameters for the NetworkDeviceSKUsClient.Get method. -type NetworkDeviceSKUsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkDeviceSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkDeviceSKUsClient.NewListBySubscriptionPager -// method. -type NetworkDeviceSKUsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkDeviceSKUsListResult - List of Network Device SKUs. type NetworkDeviceSKUsListResult struct { // Url to follow for getting next page of resources. @@ -2140,67 +1649,6 @@ type NetworkDeviceSKUsListResult struct { Value []*NetworkDeviceSKU } -// NetworkDevicesClientBeginCreateOptions contains the optional parameters for the NetworkDevicesClient.BeginCreate method. -type NetworkDevicesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginDeleteOptions contains the optional parameters for the NetworkDevicesClient.BeginDelete method. -type NetworkDevicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginRebootOptions contains the optional parameters for the NetworkDevicesClient.BeginReboot method. -type NetworkDevicesClientBeginRebootOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkDevicesClient.BeginRefreshConfiguration -// method. -type NetworkDevicesClientBeginRefreshConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateAdministrativeState -// method. -type NetworkDevicesClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginUpdateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdate method. -type NetworkDevicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientBeginUpgradeOptions contains the optional parameters for the NetworkDevicesClient.BeginUpgrade method. -type NetworkDevicesClientBeginUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkDevicesClientGetOptions contains the optional parameters for the NetworkDevicesClient.Get method. -type NetworkDevicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkDevicesClientListByResourceGroupOptions contains the optional parameters for the NetworkDevicesClient.NewListByResourceGroupPager -// method. -type NetworkDevicesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkDevicesClientListBySubscriptionOptions contains the optional parameters for the NetworkDevicesClient.NewListBySubscriptionPager -// method. -type NetworkDevicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkDevicesListResult - List of NetworkDevices. type NetworkDevicesListResult struct { // Url to follow for getting next page of resources. @@ -2332,44 +1780,6 @@ type NetworkFabricControllerProperties struct { WorkloadServices *ControllerServices } -// NetworkFabricControllersClientBeginCreateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginCreate -// method. -type NetworkFabricControllersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricControllersClientBeginDeleteOptions contains the optional parameters for the NetworkFabricControllersClient.BeginDelete -// method. -type NetworkFabricControllersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricControllersClientBeginUpdateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginUpdate -// method. -type NetworkFabricControllersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricControllersClientGetOptions contains the optional parameters for the NetworkFabricControllersClient.Get method. -type NetworkFabricControllersClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkFabricControllersClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricControllersClient.NewListByResourceGroupPager -// method. -type NetworkFabricControllersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkFabricControllersClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricControllersClient.NewListBySubscriptionPager -// method. -type NetworkFabricControllersClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkFabricControllersListResult - List of Network Fabric Controllers. type NetworkFabricControllersListResult struct { // Url to follow for getting next page of resources. @@ -2541,17 +1951,6 @@ type NetworkFabricSKUProperties struct { Type *FabricSKUType } -// NetworkFabricSKUsClientGetOptions contains the optional parameters for the NetworkFabricSKUsClient.Get method. -type NetworkFabricSKUsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkFabricSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricSKUsClient.NewListBySubscriptionPager -// method. -type NetworkFabricSKUsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkFabricSKUsListResult - List of Network Fabric SKUs. type NetworkFabricSKUsListResult struct { // Url to follow for getting next page of resources. @@ -2561,103 +1960,6 @@ type NetworkFabricSKUsListResult struct { Value []*NetworkFabricSKU } -// NetworkFabricsClientBeginCommitConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginCommitConfiguration -// method. -type NetworkFabricsClientBeginCommitConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginCreateOptions contains the optional parameters for the NetworkFabricsClient.BeginCreate method. -type NetworkFabricsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginDeleteOptions contains the optional parameters for the NetworkFabricsClient.BeginDelete method. -type NetworkFabricsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginDeprovisionOptions contains the optional parameters for the NetworkFabricsClient.BeginDeprovision -// method. -type NetworkFabricsClientBeginDeprovisionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginGetTopologyOptions contains the optional parameters for the NetworkFabricsClient.BeginGetTopology -// method. -type NetworkFabricsClientBeginGetTopologyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginProvisionOptions contains the optional parameters for the NetworkFabricsClient.BeginProvision -// method. -type NetworkFabricsClientBeginProvisionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginRefreshConfiguration -// method. -type NetworkFabricsClientBeginRefreshConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration -// method. -type NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginUpdateOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdate method. -type NetworkFabricsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration -// method. -type NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginUpgradeOptions contains the optional parameters for the NetworkFabricsClient.BeginUpgrade method. -type NetworkFabricsClientBeginUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginValidateConfiguration -// method. -type NetworkFabricsClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkFabricsClientGetOptions contains the optional parameters for the NetworkFabricsClient.Get method. -type NetworkFabricsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkFabricsClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricsClient.NewListByResourceGroupPager -// method. -type NetworkFabricsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkFabricsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricsClient.NewListBySubscriptionPager -// method. -type NetworkFabricsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkFabricsListResult - List of Network Fabrics. type NetworkFabricsListResult struct { // Url to follow for getting next page of resources. @@ -2724,45 +2026,6 @@ type NetworkInterfaceProperties struct { ProvisioningState *ProvisioningState } -// NetworkInterfacesClientBeginCreateOptions contains the optional parameters for the NetworkInterfacesClient.BeginCreate -// method. -type NetworkInterfacesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkInterfacesClientBeginDeleteOptions contains the optional parameters for the NetworkInterfacesClient.BeginDelete -// method. -type NetworkInterfacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkInterfacesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdateAdministrativeState -// method. -type NetworkInterfacesClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkInterfacesClientBeginUpdateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdate -// method. -type NetworkInterfacesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkInterfacesClientGetOptions contains the optional parameters for the NetworkInterfacesClient.Get method. -type NetworkInterfacesClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkInterfacesClientListByNetworkDeviceOptions contains the optional parameters for the NetworkInterfacesClient.NewListByNetworkDevicePager -// method. -type NetworkInterfacesClientListByNetworkDeviceOptions struct { - // placeholder for future optional parameters -} - // NetworkInterfacesList - List of NetworkInterfaces. type NetworkInterfacesList struct { // Url to follow for getting next page of resources. @@ -2823,44 +2086,6 @@ type NetworkPacketBrokerProperties struct { SourceInterfaceIDs []*string } -// NetworkPacketBrokersClientBeginCreateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginCreate -// method. -type NetworkPacketBrokersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkPacketBrokersClientBeginDeleteOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginDelete -// method. -type NetworkPacketBrokersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkPacketBrokersClientBeginUpdateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginUpdate -// method. -type NetworkPacketBrokersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkPacketBrokersClientGetOptions contains the optional parameters for the NetworkPacketBrokersClient.Get method. -type NetworkPacketBrokersClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkPacketBrokersClientListByResourceGroupOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListByResourceGroupPager -// method. -type NetworkPacketBrokersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkPacketBrokersClientListBySubscriptionOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListBySubscriptionPager -// method. -type NetworkPacketBrokersClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkPacketBrokersListResult - List of NetworkPacketBrokers. type NetworkPacketBrokersListResult struct { // Url to follow for getting next page of resources. @@ -2912,41 +2137,6 @@ type NetworkRackProperties struct { ProvisioningState *ProvisioningState } -// NetworkRacksClientBeginCreateOptions contains the optional parameters for the NetworkRacksClient.BeginCreate method. -type NetworkRacksClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkRacksClientBeginDeleteOptions contains the optional parameters for the NetworkRacksClient.BeginDelete method. -type NetworkRacksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkRacksClientBeginUpdateOptions contains the optional parameters for the NetworkRacksClient.BeginUpdate method. -type NetworkRacksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. -type NetworkRacksClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkRacksClientListByResourceGroupOptions contains the optional parameters for the NetworkRacksClient.NewListByResourceGroupPager -// method. -type NetworkRacksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkRacksClientListBySubscriptionOptions contains the optional parameters for the NetworkRacksClient.NewListBySubscriptionPager -// method. -type NetworkRacksClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkRacksListResult - List of Network Racks. type NetworkRacksListResult struct { // Url to follow for getting next page of resources. @@ -3110,7 +2300,7 @@ type NetworkTapRuleAction struct { // NetworkTapRuleMatchCondition - Defines the match condition that is supported to filter the traffic. type NetworkTapRuleMatchCondition struct { - // Encapsulation Type. + // Encapsulation Type that needs to be matched. EncapsulationType *EncapsulationType // IP condition that needs to be matched. @@ -3207,61 +2397,6 @@ type NetworkTapRuleProperties struct { ProvisioningState *ProvisioningState } -// NetworkTapRulesClientBeginCreateOptions contains the optional parameters for the NetworkTapRulesClient.BeginCreate method. -type NetworkTapRulesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientBeginDeleteOptions contains the optional parameters for the NetworkTapRulesClient.BeginDelete method. -type NetworkTapRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientBeginResyncOptions contains the optional parameters for the NetworkTapRulesClient.BeginResync method. -type NetworkTapRulesClientBeginResyncOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdateAdministrativeState -// method. -type NetworkTapRulesClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientBeginUpdateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdate method. -type NetworkTapRulesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkTapRulesClient.BeginValidateConfiguration -// method. -type NetworkTapRulesClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapRulesClientGetOptions contains the optional parameters for the NetworkTapRulesClient.Get method. -type NetworkTapRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkTapRulesClientListByResourceGroupOptions contains the optional parameters for the NetworkTapRulesClient.NewListByResourceGroupPager -// method. -type NetworkTapRulesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkTapRulesClientListBySubscriptionOptions contains the optional parameters for the NetworkTapRulesClient.NewListBySubscriptionPager -// method. -type NetworkTapRulesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkTapRulesListResult - List of NetworkTapRules. type NetworkTapRulesListResult struct { // Url to follow for getting next page of resources. @@ -3271,54 +2406,6 @@ type NetworkTapRulesListResult struct { Value []*NetworkTapRule } -// NetworkTapsClientBeginCreateOptions contains the optional parameters for the NetworkTapsClient.BeginCreate method. -type NetworkTapsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapsClientBeginDeleteOptions contains the optional parameters for the NetworkTapsClient.BeginDelete method. -type NetworkTapsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapsClientBeginResyncOptions contains the optional parameters for the NetworkTapsClient.BeginResync method. -type NetworkTapsClientBeginResyncOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdateAdministrativeState -// method. -type NetworkTapsClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapsClientBeginUpdateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdate method. -type NetworkTapsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkTapsClientGetOptions contains the optional parameters for the NetworkTapsClient.Get method. -type NetworkTapsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkTapsClientListByResourceGroupOptions contains the optional parameters for the NetworkTapsClient.NewListByResourceGroupPager -// method. -type NetworkTapsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// NetworkTapsClientListBySubscriptionOptions contains the optional parameters for the NetworkTapsClient.NewListBySubscriptionPager -// method. -type NetworkTapsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // NetworkTapsListResult - List of NetworkTaps. type NetworkTapsListResult struct { // Url to follow for getting next page of resources. @@ -3454,53 +2541,6 @@ type NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration struct { FabricASN *int64 } -// NetworkToNetworkInterconnectsClientBeginCreateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginCreate -// method. -type NetworkToNetworkInterconnectsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkToNetworkInterconnectsClientBeginDeleteOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginDelete -// method. -type NetworkToNetworkInterconnectsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState -// method. -type NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions contains the optional parameters -// for the NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState method. -type NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkToNetworkInterconnectsClientBeginUpdateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdate -// method. -type NetworkToNetworkInterconnectsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NetworkToNetworkInterconnectsClientGetOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.Get -// method. -type NetworkToNetworkInterconnectsClientGetOptions struct { - // placeholder for future optional parameters -} - -// NetworkToNetworkInterconnectsClientListByNetworkFabricOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager -// method. -type NetworkToNetworkInterconnectsClientListByNetworkFabricOptions struct { - // placeholder for future optional parameters -} - // NetworkToNetworkInterconnectsList - List of Network To Network Interconnects. type NetworkToNetworkInterconnectsList struct { // Url to follow for getting next page of resources. @@ -3571,11 +2611,6 @@ type OperationListResult struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OptionBLayer3Configuration - OptionB Layer3 Configuration properties. type OptionBLayer3Configuration struct { // ASN of PE devices for CE/PE connectivity.Example : 28 @@ -3617,7 +2652,7 @@ type PortCondition struct { // REQUIRED; Layer4 protocol type that needs to be matched. Layer4Protocol *Layer4Protocol - // List of the port Group Names that to be matched. + // List of the port Group Names that need to be matched. PortGroupNames []*string // Port type that needs to be matched. @@ -3632,7 +2667,7 @@ type PortGroupProperties struct { // The name of the port group. Name *string - // List of the ports that needs to be matched. + // List of the ports that need to be matched. Ports []*string } @@ -3642,62 +2677,6 @@ type RebootProperties struct { RebootType *RebootType } -// RoutePoliciesClientBeginCommitConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginCommitConfiguration -// method. -type RoutePoliciesClientBeginCommitConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientBeginCreateOptions contains the optional parameters for the RoutePoliciesClient.BeginCreate method. -type RoutePoliciesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientBeginDeleteOptions contains the optional parameters for the RoutePoliciesClient.BeginDelete method. -type RoutePoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdateAdministrativeState -// method. -type RoutePoliciesClientBeginUpdateAdministrativeStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientBeginUpdateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdate method. -type RoutePoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientBeginValidateConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginValidateConfiguration -// method. -type RoutePoliciesClientBeginValidateConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RoutePoliciesClientGetOptions contains the optional parameters for the RoutePoliciesClient.Get method. -type RoutePoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// RoutePoliciesClientListByResourceGroupOptions contains the optional parameters for the RoutePoliciesClient.NewListByResourceGroupPager -// method. -type RoutePoliciesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// RoutePoliciesClientListBySubscriptionOptions contains the optional parameters for the RoutePoliciesClient.NewListBySubscriptionPager -// method. -type RoutePoliciesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // RoutePoliciesListResult - List of RoutePolicies. type RoutePoliciesListResult struct { // Url to follow for getting next page of resources. @@ -3742,6 +2721,9 @@ type RoutePolicyPatch struct { // RoutePolicyPatchableProperties - Route Policy patchable properties. type RoutePolicyPatchableProperties struct { + // Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + DefaultAction *CommunityActionTypes + // Route Policy statements. Statements []*RoutePolicyStatementProperties } @@ -3757,6 +2739,9 @@ type RoutePolicyProperties struct { // Switch configuration description. Annotation *string + // Default action that needs to be applied when no condition is matched. Example: Permit | Deny. + DefaultAction *CommunityActionTypes + // Route Policy statements. Statements []*RoutePolicyStatementProperties @@ -3963,6 +2948,14 @@ type UpdateVersion struct { Version *string } +type UpgradeNetworkFabricProperties struct { + // Action to be performed while upgrading the fabric. + Action *NetworkFabricUpgradeAction + + // Specify the version. + Version *string +} + // VPNConfigurationPatchableProperties - Network and credential configuration currently applied on terminal server. type VPNConfigurationPatchableProperties struct { // ARM Resource ID of the Network To Network Interconnect. @@ -4077,14 +3070,14 @@ type VlanGroupProperties struct { Vlans []*string } -// VlanMatchCondition - The vlan match conditions that needs to be matched. +// VlanMatchCondition - The vlan match conditions that need to be matched. type VlanMatchCondition struct { - // List of inner vlans that needs to be matched. + // List of inner vlans that need to be matched. InnerVlans []*string - // List of vlan group names that to be matched. + // List of vlan group names that need to be matched. VlanGroupNames []*string - // List of vlans that needs to be matched. + // List of vlans that need to be matched. Vlans []*string } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go index 9a89b0314f02..186a79371a5c 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/models_serde.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/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 armmanagednetworkfabric @@ -237,6 +236,7 @@ func (a AccessControlListPatchProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "aclsUrl", a.ACLsURL) populate(objectMap, "annotation", a.Annotation) populate(objectMap, "configurationType", a.ConfigurationType) + populate(objectMap, "defaultAction", a.DefaultAction) populate(objectMap, "dynamicMatchConfigurations", a.DynamicMatchConfigurations) populate(objectMap, "matchConfigurations", a.MatchConfigurations) return json.Marshal(objectMap) @@ -260,6 +260,9 @@ func (a *AccessControlListPatchProperties) UnmarshalJSON(data []byte) error { case "configurationType": err = unpopulate(val, "ConfigurationType", &a.ConfigurationType) delete(rawMsg, key) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &a.DefaultAction) + delete(rawMsg, key) case "dynamicMatchConfigurations": err = unpopulate(val, "DynamicMatchConfigurations", &a.DynamicMatchConfigurations) delete(rawMsg, key) @@ -325,6 +328,7 @@ func (a AccessControlListProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "annotation", a.Annotation) populate(objectMap, "configurationState", a.ConfigurationState) populate(objectMap, "configurationType", a.ConfigurationType) + populate(objectMap, "defaultAction", a.DefaultAction) populate(objectMap, "dynamicMatchConfigurations", a.DynamicMatchConfigurations) populateTimeRFC3339(objectMap, "lastSyncedTime", a.LastSyncedTime) populate(objectMap, "matchConfigurations", a.MatchConfigurations) @@ -356,6 +360,9 @@ func (a *AccessControlListProperties) UnmarshalJSON(data []byte) error { case "configurationType": err = unpopulate(val, "ConfigurationType", &a.ConfigurationType) delete(rawMsg, key) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &a.DefaultAction) + delete(rawMsg, key) case "dynamicMatchConfigurations": err = unpopulate(val, "DynamicMatchConfigurations", &a.DynamicMatchConfigurations) delete(rawMsg, key) @@ -6702,6 +6709,7 @@ func (r *RoutePolicyPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RoutePolicyPatchableProperties. func (r RoutePolicyPatchableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "defaultAction", r.DefaultAction) populate(objectMap, "statements", r.Statements) return json.Marshal(objectMap) } @@ -6715,6 +6723,9 @@ func (r *RoutePolicyPatchableProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "defaultAction": + err = unpopulate(val, "DefaultAction", &r.DefaultAction) + delete(rawMsg, key) case "statements": err = unpopulate(val, "Statements", &r.Statements) delete(rawMsg, key) @@ -6733,6 +6744,7 @@ func (r RoutePolicyProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "administrativeState", r.AdministrativeState) populate(objectMap, "annotation", r.Annotation) populate(objectMap, "configurationState", r.ConfigurationState) + populate(objectMap, "defaultAction", r.DefaultAction) populate(objectMap, "networkFabricId", r.NetworkFabricID) populate(objectMap, "provisioningState", r.ProvisioningState) populate(objectMap, "statements", r.Statements) @@ -6760,6 +6772,9 @@ func (r *RoutePolicyProperties) UnmarshalJSON(data []byte) error { case "configurationState": err = unpopulate(val, "ConfigurationState", &r.ConfigurationState) delete(rawMsg, key) + case "defaultAction": + err = unpopulate(val, "DefaultAction", &r.DefaultAction) + delete(rawMsg, key) case "networkFabricId": err = unpopulate(val, "NetworkFabricID", &r.NetworkFabricID) delete(rawMsg, key) @@ -7318,6 +7333,37 @@ func (u *UpdateVersion) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UpgradeNetworkFabricProperties. +func (u UpgradeNetworkFabricProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", u.Action) + populate(objectMap, "version", u.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpgradeNetworkFabricProperties. +func (u *UpgradeNetworkFabricProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &u.Action) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &u.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type VPNConfigurationPatchableProperties. func (v VPNConfigurationPatchableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go index 07d03764ccdd..e569d43499f1 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NeighborGroupsClient) BeginCreate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NeighborGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NeighborGroupsClient) BeginCreate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NeighborGroupsClient) create(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroup, options *NeighborGroupsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, neighborGroupName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NeighborGroupsClient) createCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements Neighbor Group DELETE method. @@ -123,9 +128,10 @@ func (client *NeighborGroupsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NeighborGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NeighborGroupsClient) BeginDelete(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NeighborGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, neighborGroupName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *NeighborGroupsClient) deleteCreateRequest(ctx context.Context, res // - neighborGroupName - Name of the Neighbor Group. // - options - NeighborGroupsClientGetOptions contains the optional parameters for the NeighborGroupsClient.Get method. func (client *NeighborGroupsClient) Get(ctx context.Context, resourceGroupName string, neighborGroupName string, options *NeighborGroupsClientGetOptions) (NeighborGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, neighborGroupName, options) if err != nil { return NeighborGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NeighborGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NeighborGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NeighborGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -361,9 +372,10 @@ func (client *NeighborGroupsClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NeighborGroupsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NeighborGroupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,18 +386,20 @@ func (client *NeighborGroupsClient) BeginUpdate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NeighborGroupsClient) update(ctx context.Context, resourceGroupName string, neighborGroupName string, body NeighborGroupPatch, options *NeighborGroupsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, neighborGroupName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -408,5 +422,8 @@ func (client *NeighborGroupsClient) updateCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go deleted file mode 100644 index eec78a71005a..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/neighborgroups_client_example_test.go +++ /dev/null @@ -1,402 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Create_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNeighborGroupsClient().BeginCreate(ctx, "example-rg", "example-neighborGroup", armmanagednetworkfabric.NeighborGroup{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key8107": to.Ptr("1234"), - }, - Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - Annotation: to.Ptr("annotation"), - Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - IPv4Addresses: []*string{ - to.Ptr("10.10.10.10"), - to.Ptr("20.10.10.10"), - to.Ptr("30.10.10.10"), - to.Ptr("40.10.10.10"), - to.Ptr("50.10.10.10"), - to.Ptr("60.10.10.10"), - to.Ptr("70.10.10.10"), - to.Ptr("80.10.10.10"), - to.Ptr("90.10.10.10")}, - IPv6Addresses: []*string{ - to.Ptr("2F::/100")}, - }, - }, - }, 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.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ - // Name: to.Ptr("example-neighborGroup"), - // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - // Annotation: to.Ptr("annotation"), - // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - // IPv4Addresses: []*string{ - // to.Ptr("10.10.10.10"), - // to.Ptr("20.10.10.10"), - // to.Ptr("30.10.10.10"), - // to.Ptr("40.10.10.10"), - // to.Ptr("50.10.10.10"), - // to.Ptr("60.10.10.10"), - // to.Ptr("70.10.10.10"), - // to.Ptr("80.10.10.10"), - // to.Ptr("90.10.10.10")}, - // IPv6Addresses: []*string{ - // to.Ptr("2F::/100")}, - // }, - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // NetworkTapRuleIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Get_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNeighborGroupsClient().Get(ctx, "example-rg", "example-neighborGroup", 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.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ - // Name: to.Ptr("example-neighborGroup"), - // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - // Annotation: to.Ptr("annotation"), - // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - // IPv4Addresses: []*string{ - // to.Ptr("10.10.10.10"), - // to.Ptr("20.10.10.10"), - // to.Ptr("30.10.10.10"), - // to.Ptr("40.10.10.10"), - // to.Ptr("50.10.10.10"), - // to.Ptr("60.10.10.10"), - // to.Ptr("70.10.10.10"), - // to.Ptr("80.10.10.10"), - // to.Ptr("90.10.10.10")}, - // IPv6Addresses: []*string{ - // to.Ptr("2F::/100")}, - // }, - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // NetworkTapRuleIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Update_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNeighborGroupsClient().BeginUpdate(ctx, "example-rg", "example-neighborGroup", armmanagednetworkfabric.NeighborGroupPatch{ - Tags: map[string]*string{ - "key8107": to.Ptr("2345"), - }, - Properties: &armmanagednetworkfabric.NeighborGroupPatchProperties{ - Annotation: to.Ptr("Updating"), - Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - IPv4Addresses: []*string{ - to.Ptr("10.10.10.10"), - to.Ptr("20.10.10.10"), - to.Ptr("30.10.10.10"), - to.Ptr("40.10.10.10"), - to.Ptr("50.10.10.10"), - to.Ptr("60.10.10.10"), - to.Ptr("70.10.10.10"), - to.Ptr("80.10.10.10"), - to.Ptr("90.10.10.10")}, - IPv6Addresses: []*string{ - to.Ptr("2F::/100")}, - }, - }, - }, 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.NeighborGroup = armmanagednetworkfabric.NeighborGroup{ - // Name: to.Ptr("example-neighborGroup"), - // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key8107": to.Ptr("2345"), - // }, - // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - // Annotation: to.Ptr("ivjs"), - // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - // IPv4Addresses: []*string{ - // to.Ptr("10.10.10.10"), - // to.Ptr("20.10.10.10"), - // to.Ptr("30.10.10.10"), - // to.Ptr("40.10.10.10"), - // to.Ptr("50.10.10.10"), - // to.Ptr("60.10.10.10"), - // to.Ptr("70.10.10.10"), - // to.Ptr("80.10.10.10"), - // to.Ptr("90.10.10.10")}, - // IPv6Addresses: []*string{ - // to.Ptr("2F::/100")}, - // }, - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // NetworkTapRuleIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_Delete_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNeighborGroupsClient().BeginDelete(ctx, "example-rg", "example-neighborGroup", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNeighborGroupsClient().NewListByResourceGroupPager("example-rg", 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.NeighborGroupsListResult = armmanagednetworkfabric.NeighborGroupsListResult{ - // Value: []*armmanagednetworkfabric.NeighborGroup{ - // { - // Name: to.Ptr("example-neighborGroup"), - // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - // Annotation: to.Ptr("annotation"), - // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - // IPv4Addresses: []*string{ - // to.Ptr("10.10.10.10"), - // to.Ptr("20.10.10.10"), - // to.Ptr("30.10.10.10"), - // to.Ptr("40.10.10.10"), - // to.Ptr("50.10.10.10"), - // to.Ptr("60.10.10.10"), - // to.Ptr("70.10.10.10"), - // to.Ptr("80.10.10.10"), - // to.Ptr("90.10.10.10")}, - // IPv6Addresses: []*string{ - // to.Ptr("2F::/100")}, - // }, - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // NetworkTapRuleIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NeighborGroups_ListBySubscription_MaximumSet_Gen.json -func ExampleNeighborGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNeighborGroupsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NeighborGroupsListResult = armmanagednetworkfabric.NeighborGroupsListResult{ - // Value: []*armmanagednetworkfabric.NeighborGroup{ - // { - // Name: to.Ptr("example-neighborGroup"), - // Type: to.Ptr("microsoft.managednetworkfabric/neighborGroups"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.193Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-23T05:49:59.194Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NeighborGroupProperties{ - // Annotation: to.Ptr("annotation"), - // Destination: &armmanagednetworkfabric.NeighborGroupDestination{ - // IPv4Addresses: []*string{ - // to.Ptr("10.10.10.10"), - // to.Ptr("20.10.10.10"), - // to.Ptr("30.10.10.10"), - // to.Ptr("40.10.10.10"), - // to.Ptr("50.10.10.10"), - // to.Ptr("60.10.10.10"), - // to.Ptr("70.10.10.10"), - // to.Ptr("80.10.10.10"), - // to.Ptr("90.10.10.10")}, - // IPv6Addresses: []*string{ - // to.Ptr("2F::/100")}, - // }, - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // NetworkTapRuleIDs: []*string{ - // to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-networkTapRule")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go index 4f203467155e..dbc25db40f43 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NetworkDevicesClient) BeginCreate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NetworkDevicesClient) BeginCreate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) create(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevice, options *NetworkDevicesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkDeviceName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NetworkDevicesClient) createCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the Network Device resource. @@ -123,9 +128,10 @@ func (client *NetworkDevicesClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NetworkDevicesClient) BeginDelete(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkDeviceName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *NetworkDevicesClient) deleteCreateRequest(ctx context.Context, res // - networkDeviceName - Name of the Network Device. // - options - NetworkDevicesClientGetOptions contains the optional parameters for the NetworkDevicesClient.Get method. func (client *NetworkDevicesClient) Get(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientGetOptions) (NetworkDevicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkDeviceName, options) if err != nil { return NetworkDevicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkDevicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkDevicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkDevicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -361,9 +372,10 @@ func (client *NetworkDevicesClient) BeginReboot(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRebootResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRebootResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientRebootResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,18 +386,20 @@ func (client *NetworkDevicesClient) BeginReboot(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) reboot(ctx context.Context, resourceGroupName string, networkDeviceName string, body RebootProperties, options *NetworkDevicesClientBeginRebootOptions) (*http.Response, error) { + var err error req, err := client.rebootCreateRequest(ctx, resourceGroupName, networkDeviceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // rebootCreateRequest creates the Reboot request. @@ -408,7 +422,10 @@ func (client *NetworkDevicesClient) rebootCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginRefreshConfiguration - Refreshes the configuration the Network Device. @@ -425,9 +442,10 @@ func (client *NetworkDevicesClient) BeginRefreshConfiguration(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRefreshConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientRefreshConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientRefreshConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -438,18 +456,20 @@ func (client *NetworkDevicesClient) BeginRefreshConfiguration(ctx context.Contex // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) refreshConfiguration(ctx context.Context, resourceGroupName string, networkDeviceName string, options *NetworkDevicesClientBeginRefreshConfigurationOptions) (*http.Response, error) { + var err error req, err := client.refreshConfigurationCreateRequest(ctx, resourceGroupName, networkDeviceName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshConfigurationCreateRequest creates the RefreshConfiguration request. @@ -490,9 +510,10 @@ func (client *NetworkDevicesClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -503,18 +524,20 @@ func (client *NetworkDevicesClient) BeginUpdate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) update(ctx context.Context, resourceGroupName string, networkDeviceName string, body NetworkDevicePatchParameters, options *NetworkDevicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkDeviceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -537,7 +560,10 @@ func (client *NetworkDevicesClient) updateCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Updates the Administrative state of the Network Device. @@ -555,9 +581,10 @@ func (client *NetworkDevicesClient) BeginUpdateAdministrativeState(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -568,18 +595,20 @@ func (client *NetworkDevicesClient) BeginUpdateAdministrativeState(ctx context.C // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateDeviceAdministrativeState, options *NetworkDevicesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkDeviceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -602,7 +631,10 @@ func (client *NetworkDevicesClient) updateAdministrativeStateCreateRequest(ctx c reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpgrade - Upgrades the version of the Network Device. @@ -620,9 +652,10 @@ func (client *NetworkDevicesClient) BeginUpgrade(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpgradeResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkDevicesClientUpgradeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkDevicesClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -633,18 +666,20 @@ func (client *NetworkDevicesClient) BeginUpgrade(ctx context.Context, resourceGr // // Generated from API version 2023-06-15 func (client *NetworkDevicesClient) upgrade(ctx context.Context, resourceGroupName string, networkDeviceName string, body UpdateVersion, options *NetworkDevicesClientBeginUpgradeOptions) (*http.Response, error) { + var err error req, err := client.upgradeCreateRequest(ctx, resourceGroupName, networkDeviceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // upgradeCreateRequest creates the Upgrade request. @@ -667,5 +702,8 @@ func (client *NetworkDevicesClient) upgradeCreateRequest(ctx context.Context, re reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go deleted file mode 100644 index 307b93eac7c3..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdevices_client_example_test.go +++ /dev/null @@ -1,507 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Create_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginCreate(ctx, "example-rg", "example-device", armmanagednetworkfabric.NetworkDevice{ - Location: to.Ptr("eastuseuap"), - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - Annotation: to.Ptr("annotation"), - HostName: to.Ptr("NFA-Device"), - SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - NetworkDeviceSKU: to.Ptr("DeviceSku"), - }, - }, 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.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("example-device"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("annotation"), - // HostName: to.Ptr("NFA-Device"), - // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ManagementIPv4Address: to.Ptr("10.10.10.10"), - // ManagementIPv6Address: to.Ptr("2F::1/100"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), - // NetworkDeviceSKU: to.Ptr("DeviceSku"), - // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Get_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkDevicesClient().Get(ctx, "example-rg", "example-device", 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.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("example-device"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("annotation"), - // HostName: to.Ptr("NFA-Device"), - // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ManagementIPv4Address: to.Ptr("10.10.10.10"), - // ManagementIPv6Address: to.Ptr("2F::1/100"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), - // NetworkDeviceSKU: to.Ptr("DeviceSku"), - // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Update_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdate(ctx, "example-rg", "example-device", armmanagednetworkfabric.NetworkDevicePatchParameters{ - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkDevicePatchParametersProperties{ - Annotation: to.Ptr("annotation"), - HostName: to.Ptr("NFA-Device"), - SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - }, - }, 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.NetworkDevice = armmanagednetworkfabric.NetworkDevice{ - // Name: to.Ptr("example-device"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("annotation"), - // HostName: to.Ptr("NFA-Device"), - // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ManagementIPv4Address: to.Ptr("10.10.10.10"), - // ManagementIPv6Address: to.Ptr("2F::1/100"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), - // NetworkDeviceSKU: to.Ptr("DeviceSku"), - // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Delete_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginDelete(ctx, "example-rg", "example-device", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkDevicesClient().NewListByResourceGroupPager("example-rg", 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.NetworkDevicesListResult = armmanagednetworkfabric.NetworkDevicesListResult{ - // Value: []*armmanagednetworkfabric.NetworkDevice{ - // { - // Name: to.Ptr("example-device"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("annotation"), - // HostName: to.Ptr("NFA-Device"), - // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ManagementIPv4Address: to.Ptr("10.10.10.10"), - // ManagementIPv6Address: to.Ptr("2F::1/100"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), - // NetworkDeviceSKU: to.Ptr("DeviceSku"), - // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkDevicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkDevicesListResult = armmanagednetworkfabric.NetworkDevicesListResult{ - // Value: []*armmanagednetworkfabric.NetworkDevice{ - // { - // Name: to.Ptr("example-device"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceProperties{ - // Annotation: to.Ptr("annotation"), - // HostName: to.Ptr("NFA-Device"), - // SerialNumber: to.Ptr("Vendor;DCS-7280XXX-24;12.05;JPE2111XXXX"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // ManagementIPv4Address: to.Ptr("10.10.10.10"), - // ManagementIPv6Address: to.Ptr("2F::1/100"), - // NetworkDeviceRole: to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleCE), - // NetworkDeviceSKU: to.Ptr("DeviceSku"), - // NetworkRackID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // Version: to.Ptr("1.0"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Reboot_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginReboot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginReboot(ctx, "example-rg", "example-device", armmanagednetworkfabric.RebootProperties{ - RebootType: to.Ptr(armmanagednetworkfabric.RebootTypeGracefulRebootWithZTP), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_RefreshConfiguration_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginRefreshConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginRefreshConfiguration(ctx, "example-rg", "example-device", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-device", armmanagednetworkfabric.UpdateDeviceAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.DeviceAdministrativeStateRMA), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDevices_Upgrade_MaximumSet_Gen.json -func ExampleNetworkDevicesClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkDevicesClient().BeginUpgrade(ctx, "example-rg", "example-device", armmanagednetworkfabric.UpdateVersion{ - Version: to.Ptr("1.0.0"), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go index a0baa1e40e80..896362d3c493 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_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 armmanagednetworkfabric @@ -51,18 +50,21 @@ func NewNetworkDeviceSKUsClient(subscriptionID string, credential azcore.TokenCr // - networkDeviceSKUName - Name of the Network Device SKU. // - options - NetworkDeviceSKUsClientGetOptions contains the optional parameters for the NetworkDeviceSKUsClient.Get method. func (client *NetworkDeviceSKUsClient) Get(ctx context.Context, networkDeviceSKUName string, options *NetworkDeviceSKUsClientGetOptions) (NetworkDeviceSKUsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, networkDeviceSKUName, options) if err != nil { return NetworkDeviceSKUsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkDeviceSKUsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkDeviceSKUsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkDeviceSKUsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go deleted file mode 100644 index ae159d459675..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkdeviceskus_client_example_test.go +++ /dev/null @@ -1,140 +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 armmanagednetworkfabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_Get_MaximumSet_Gen.json -func ExampleNetworkDeviceSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkDeviceSKUsClient().Get(ctx, "example-deviceSku", 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.NetworkDeviceSKU = armmanagednetworkfabric.NetworkDeviceSKU{ - // Name: to.Ptr("example-deviceSku"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkDeviceSkus"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/example-deviceSku"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr("HundredGigE0/0"), - // InterfaceType: to.Ptr("type1"), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr("Optical"), - // MaxSpeedInMbps: to.Ptr[int32](100), - // }}, - // }}, - // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("model1"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsDefault: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // VendorFirmwareVersion: to.Ptr("11.2"), - // VendorOsVersion: to.Ptr("2.0"), - // Version: to.Ptr("1.0.0"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkDeviceSkus_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkDeviceSKUsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkDeviceSKUsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkDeviceSKUsListResult = armmanagednetworkfabric.NetworkDeviceSKUsListResult{ - // Value: []*armmanagednetworkfabric.NetworkDeviceSKU{ - // { - // Name: to.Ptr("example-deviceSku"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkDeviceSkus"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkDeviceSkus/example-deviceSku"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:55:43.467Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkDeviceSKUProperties{ - // Interfaces: []*armmanagednetworkfabric.DeviceInterfaceProperties{ - // { - // Identifier: to.Ptr("HundredGigE0/0"), - // InterfaceType: to.Ptr("type1"), - // SupportedConnectorTypes: []*armmanagednetworkfabric.SupportedConnectorProperties{ - // { - // ConnectorType: to.Ptr("Optical"), - // MaxSpeedInMbps: to.Ptr[int32](100), - // }}, - // }}, - // Manufacturer: to.Ptr("Arista"), - // Model: to.Ptr("model1"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SupportedRoleTypes: []*armmanagednetworkfabric.NetworkDeviceRoleName{ - // to.Ptr(armmanagednetworkfabric.NetworkDeviceRoleNameCE)}, - // SupportedVersions: []*armmanagednetworkfabric.SupportedVersionProperties{ - // { - // IsDefault: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // VendorFirmwareVersion: to.Ptr("11.2"), - // VendorOsVersion: to.Ptr("2.0"), - // Version: to.Ptr("1.0.0"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go index 52bb32ccbc57..47a3afa43c26 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NetworkFabricControllersClient) BeginCreate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricControllersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NetworkFabricControllersClient) BeginCreate(ctx context.Context, r // // Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) create(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricController, options *NetworkFabricControllersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricControllerName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NetworkFabricControllersClient) createCreateRequest(ctx context.Co reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the Network Fabric Controller resource. @@ -123,9 +128,10 @@ func (client *NetworkFabricControllersClient) BeginDelete(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricControllersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NetworkFabricControllersClient) BeginDelete(ctx context.Context, r // // Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricControllerName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,18 +190,21 @@ func (client *NetworkFabricControllersClient) deleteCreateRequest(ctx context.Co // - options - NetworkFabricControllersClientGetOptions contains the optional parameters for the NetworkFabricControllersClient.Get // method. func (client *NetworkFabricControllersClient) Get(ctx context.Context, resourceGroupName string, networkFabricControllerName string, options *NetworkFabricControllersClientGetOptions) (NetworkFabricControllersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkFabricControllerName, options) if err != nil { return NetworkFabricControllersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkFabricControllersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFabricControllersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFabricControllersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -362,9 +373,10 @@ func (client *NetworkFabricControllersClient) BeginUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricControllersClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricControllersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -375,18 +387,20 @@ func (client *NetworkFabricControllersClient) BeginUpdate(ctx context.Context, r // // Generated from API version 2023-06-15 func (client *NetworkFabricControllersClient) update(ctx context.Context, resourceGroupName string, networkFabricControllerName string, body NetworkFabricControllerPatch, options *NetworkFabricControllersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricControllerName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -409,5 +423,8 @@ func (client *NetworkFabricControllersClient) updateCreateRequest(ctx context.Co reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go deleted file mode 100644 index 682fd287a8d6..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabriccontrollers_client_example_test.go +++ /dev/null @@ -1,455 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Create_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginCreate(ctx, "example-rg", "example-networkController", armmanagednetworkfabric.NetworkFabricController{ - Location: to.Ptr("eastus"), - Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - Annotation: to.Ptr("annotation"), - InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - { - ExpressRouteAuthorizationKey: to.Ptr("1234ABCD-0A1B-1234-5678-123456ABCDEF"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - }}, - WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - { - ExpressRouteAuthorizationKey: to.Ptr("xxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - }}, - IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - IPv6AddressSpace: to.Ptr("::/60"), - IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - Name: to.Ptr("managedResourceGroupName"), - Location: to.Ptr("eastus"), - }, - NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - }, - }, 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.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("example-networkController"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - // Annotation: to.Ptr("annotation"), - // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.0.0/19")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - // IPv6AddressSpace: to.Ptr("::/60"), - // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // NetworkFabricIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, - // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // TenantInternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // WorkloadManagementNetwork: to.Ptr(true), - // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Get_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkFabricControllersClient().Get(ctx, "example-rg", "example-networkController", 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.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("example-networkController"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - // Annotation: to.Ptr("annotation"), - // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.0.0/19")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - // IPv6AddressSpace: to.Ptr("::/60"), - // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // NetworkFabricIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, - // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // TenantInternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // WorkloadManagementNetwork: to.Ptr(true), - // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Update_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginUpdate(ctx, "example-rg", "example-networkController", armmanagednetworkfabric.NetworkFabricControllerPatch{ - Properties: &armmanagednetworkfabric.NetworkFabricControllerPatchableProperties{ - InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - { - ExpressRouteAuthorizationKey: to.Ptr("xxxxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - }}, - WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - { - ExpressRouteAuthorizationKey: to.Ptr("xxxxxxx"), - ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - }}, - }, - }, 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.NetworkFabricController = armmanagednetworkfabric.NetworkFabricController{ - // Name: to.Ptr("example-networkController"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - // Annotation: to.Ptr("annotation"), - // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.0.0/19")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - // IPv6AddressSpace: to.Ptr("::/60"), - // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // NetworkFabricIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, - // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // TenantInternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // WorkloadManagementNetwork: to.Ptr(true), - // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_Delete_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricControllersClient().BeginDelete(ctx, "example-rg", "example-networkController", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFabricControllersClient().NewListByResourceGroupPager("example-rg", 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.NetworkFabricControllersListResult = armmanagednetworkfabric.NetworkFabricControllersListResult{ - // Value: []*armmanagednetworkfabric.NetworkFabricController{ - // { - // Name: to.Ptr("example-networkController"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - // Annotation: to.Ptr("annotation"), - // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.0.0/19")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - // IPv6AddressSpace: to.Ptr("::/60"), - // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // NetworkFabricIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, - // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // TenantInternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // WorkloadManagementNetwork: to.Ptr(true), - // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricControllers_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkFabricControllersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFabricControllersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkFabricControllersListResult = armmanagednetworkfabric.NetworkFabricControllersListResult{ - // Value: []*armmanagednetworkfabric.NetworkFabricController{ - // { - // Name: to.Ptr("example-networkController"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkfabriccontrollers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-networkController"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-29T05:17:40.665Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Properties: &armmanagednetworkfabric.NetworkFabricControllerProperties{ - // Annotation: to.Ptr("annotation"), - // InfrastructureExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // WorkloadExpressRouteConnections: []*armmanagednetworkfabric.ExpressRouteConnectionInformation{ - // { - // ExpressRouteCircuitID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitName"), - // }}, - // InfrastructureServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.0.0/19")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // IPv4AddressSpace: to.Ptr("172.253.0.0/19"), - // IPv6AddressSpace: to.Ptr("::/60"), - // IsWorkloadManagementNetworkEnabled: to.Ptr(armmanagednetworkfabric.IsWorkloadManagementNetworkEnabledTrue), - // ManagedResourceGroupConfiguration: &armmanagednetworkfabric.ManagedResourceGroupConfiguration{ - // Name: to.Ptr("managedResourceGroupName"), - // Location: to.Ptr("eastus"), - // }, - // NetworkFabricIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/eaxmple-fabric")}, - // NfcSKU: to.Ptr(armmanagednetworkfabric.NfcSKUStandard), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // TenantInternetGatewayIDs: []*string{ - // to.Ptr("/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/internetGateways/example-internetGateway")}, - // WorkloadManagementNetwork: to.Ptr(true), - // WorkloadServices: &armmanagednetworkfabric.ControllerServices{ - // IPv4AddressSpaces: []*string{ - // to.Ptr("172.253.28.0/22")}, - // IPv6AddressSpaces: []*string{ - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go index d1a33ffe2d2e..1cf2bde8754a 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *NetworkFabricsClient) BeginCommitConfiguration(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientCommitConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *NetworkFabricsClient) BeginCommitConfiguration(ctx context.Context // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) commitConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginCommitConfigurationOptions) (*http.Response, error) { + var err error req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitConfigurationCreateRequest creates the CommitConfiguration request. @@ -123,9 +125,10 @@ func (client *NetworkFabricsClient) BeginCreate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +139,20 @@ func (client *NetworkFabricsClient) BeginCreate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) create(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabric, options *NetworkFabricsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -170,7 +175,10 @@ func (client *NetworkFabricsClient) createCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Network Fabric resource. @@ -187,9 +195,10 @@ func (client *NetworkFabricsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -200,18 +209,20 @@ func (client *NetworkFabricsClient) BeginDelete(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -251,9 +262,10 @@ func (client *NetworkFabricsClient) BeginDeprovision(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientDeprovisionResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientDeprovisionResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientDeprovisionResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -264,18 +276,20 @@ func (client *NetworkFabricsClient) BeginDeprovision(ctx context.Context, resour // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) deprovision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginDeprovisionOptions) (*http.Response, error) { + var err error req, err := client.deprovisionCreateRequest(ctx, resourceGroupName, networkFabricName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deprovisionCreateRequest creates the Deprovision request. @@ -309,18 +323,21 @@ func (client *NetworkFabricsClient) deprovisionCreateRequest(ctx context.Context // - networkFabricName - Name of the Network Fabric. // - options - NetworkFabricsClientGetOptions contains the optional parameters for the NetworkFabricsClient.Get method. func (client *NetworkFabricsClient) Get(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientGetOptions) (NetworkFabricsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkFabricName, options) if err != nil { return NetworkFabricsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkFabricsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFabricsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFabricsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -369,9 +386,10 @@ func (client *NetworkFabricsClient) BeginGetTopology(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientGetTopologyResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientGetTopologyResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientGetTopologyResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -382,18 +400,20 @@ func (client *NetworkFabricsClient) BeginGetTopology(ctx context.Context, resour // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) getTopology(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginGetTopologyOptions) (*http.Response, error) { + var err error req, err := client.getTopologyCreateRequest(ctx, resourceGroupName, networkFabricName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // getTopologyCreateRequest creates the GetTopology request. @@ -552,9 +572,10 @@ func (client *NetworkFabricsClient) BeginProvision(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientProvisionResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientProvisionResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientProvisionResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -565,18 +586,20 @@ func (client *NetworkFabricsClient) BeginProvision(ctx context.Context, resource // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) provision(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginProvisionOptions) (*http.Response, error) { + var err error req, err := client.provisionCreateRequest(ctx, resourceGroupName, networkFabricName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // provisionCreateRequest creates the Provision request. @@ -616,9 +639,10 @@ func (client *NetworkFabricsClient) BeginRefreshConfiguration(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientRefreshConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientRefreshConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientRefreshConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -629,18 +653,20 @@ func (client *NetworkFabricsClient) BeginRefreshConfiguration(ctx context.Contex // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) refreshConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, options *NetworkFabricsClientBeginRefreshConfigurationOptions) (*http.Response, error) { + var err error req, err := client.refreshConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshConfigurationCreateRequest creates the RefreshConfiguration request. @@ -681,9 +707,10 @@ func (client *NetworkFabricsClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -694,18 +721,20 @@ func (client *NetworkFabricsClient) BeginUpdate(ctx context.Context, resourceGro // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) update(ctx context.Context, resourceGroupName string, networkFabricName string, body NetworkFabricPatch, options *NetworkFabricsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -728,7 +757,10 @@ func (client *NetworkFabricsClient) updateCreateRequest(ctx context.Context, res reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateInfraManagementBfdConfiguration - Updates the Infra Management BFD Configuration of the underlying resources @@ -747,9 +779,10 @@ func (client *NetworkFabricsClient) BeginUpdateInfraManagementBfdConfiguration(c if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -761,18 +794,20 @@ func (client *NetworkFabricsClient) BeginUpdateInfraManagementBfdConfiguration(c // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) updateInfraManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions) (*http.Response, error) { + var err error req, err := client.updateInfraManagementBfdConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateInfraManagementBfdConfigurationCreateRequest creates the UpdateInfraManagementBfdConfiguration request. @@ -795,7 +830,10 @@ func (client *NetworkFabricsClient) updateInfraManagementBfdConfigurationCreateR reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateWorkloadManagementBfdConfiguration - Updates the Workload Management BFD Configuration of the underlying resources @@ -814,9 +852,10 @@ func (client *NetworkFabricsClient) BeginUpdateWorkloadManagementBfdConfiguratio if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -828,18 +867,20 @@ func (client *NetworkFabricsClient) BeginUpdateWorkloadManagementBfdConfiguratio // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) updateWorkloadManagementBfdConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateAdministrativeState, options *NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions) (*http.Response, error) { + var err error req, err := client.updateWorkloadManagementBfdConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateWorkloadManagementBfdConfigurationCreateRequest creates the UpdateWorkloadManagementBfdConfiguration request. @@ -862,7 +903,10 @@ func (client *NetworkFabricsClient) updateWorkloadManagementBfdConfigurationCrea reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpgrade - Upgrades the version of the underlying resources in the given Network Fabric instance. @@ -874,15 +918,16 @@ func (client *NetworkFabricsClient) updateWorkloadManagementBfdConfigurationCrea // - body - Network Fabric properties to update. // - options - NetworkFabricsClientBeginUpgradeOptions contains the optional parameters for the NetworkFabricsClient.BeginUpgrade // method. -func (client *NetworkFabricsClient) BeginUpgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*runtime.Poller[NetworkFabricsClientUpgradeResponse], error) { +func (client *NetworkFabricsClient) BeginUpgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpgradeNetworkFabricProperties, options *NetworkFabricsClientBeginUpgradeOptions) (*runtime.Poller[NetworkFabricsClientUpgradeResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.upgrade(ctx, resourceGroupName, networkFabricName, body, options) if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpgradeResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientUpgradeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientUpgradeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -892,23 +937,25 @@ func (client *NetworkFabricsClient) BeginUpgrade(ctx context.Context, resourceGr // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2023-06-15 -func (client *NetworkFabricsClient) upgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*http.Response, error) { +func (client *NetworkFabricsClient) upgrade(ctx context.Context, resourceGroupName string, networkFabricName string, body UpgradeNetworkFabricProperties, options *NetworkFabricsClientBeginUpgradeOptions) (*http.Response, error) { + var err error req, err := client.upgradeCreateRequest(ctx, resourceGroupName, networkFabricName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // upgradeCreateRequest creates the Upgrade request. -func (client *NetworkFabricsClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body UpdateVersion, options *NetworkFabricsClientBeginUpgradeOptions) (*policy.Request, error) { +func (client *NetworkFabricsClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, networkFabricName string, body UpgradeNetworkFabricProperties, options *NetworkFabricsClientBeginUpgradeOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedNetworkFabric/networkFabrics/{networkFabricName}/upgrade" urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { @@ -927,7 +974,10 @@ func (client *NetworkFabricsClient) upgradeCreateRequest(ctx context.Context, re reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Validates the configuration of the underlying resources in the given Network Fabric instance. @@ -945,9 +995,10 @@ func (client *NetworkFabricsClient) BeginValidateConfiguration(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkFabricsClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkFabricsClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -958,18 +1009,20 @@ func (client *NetworkFabricsClient) BeginValidateConfiguration(ctx context.Conte // // Generated from API version 2023-06-15 func (client *NetworkFabricsClient) validateConfiguration(ctx context.Context, resourceGroupName string, networkFabricName string, body ValidateConfigurationProperties, options *NetworkFabricsClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, networkFabricName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. @@ -992,5 +1045,8 @@ func (client *NetworkFabricsClient) validateConfigurationCreateRequest(ctx conte reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go deleted file mode 100644 index 18adbbd86e22..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabrics_client_example_test.go +++ /dev/null @@ -1,1327 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Create_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginCreate(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.NetworkFabric{ - Location: to.Ptr("eastuseuap"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - Annotation: to.Ptr("annotation"), - FabricASN: to.Ptr[int64](29249), - IPv4Prefix: to.Ptr("10.18.0.0/19"), - IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](10), - }, - Mtu: to.Ptr[int32](1501), - PeerASN: to.Ptr[int64](1235), - VlanID: to.Ptr[int32](3001), - }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - }, - WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](5), - }, - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int64](61234), - VlanID: to.Ptr[int32](3000), - }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10039")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10039")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - }, - }, - NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - RackCount: to.Ptr[int32](4), - ServerCountPerRack: to.Ptr[int32](8), - TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - Password: to.Ptr("xxxx"), - SerialNumber: to.Ptr("123456"), - Username: to.Ptr("username"), - }, - }, - }, 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.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("example-fabric"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("email@email.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FabricASN: to.Ptr[int64](29249), - // FabricVersion: to.Ptr("version1"), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, - // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](10), - // }, - // Mtu: to.Ptr[int32](1501), - // PeerASN: to.Ptr[int64](1235), - // VlanID: to.Ptr[int32](3001), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](3000), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // Racks: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, - // RouterIDs: []*string{ - // to.Ptr("routerId")}, - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Get_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkFabricsClient().Get(ctx, "example-rg", "example-fabric", 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.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("example-fabric"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("email@email.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FabricASN: to.Ptr[int64](29249), - // FabricVersion: to.Ptr("version1"), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, - // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](10), - // }, - // Mtu: to.Ptr[int32](1501), - // PeerASN: to.Ptr[int64](1235), - // VlanID: to.Ptr[int32](3001), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](3000), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // Racks: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, - // RouterIDs: []*string{ - // to.Ptr("routerId")}, - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Update_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdate(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.NetworkFabricPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("KeyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkFabricPatchProperties{ - Annotation: to.Ptr("annotation1"), - FabricASN: to.Ptr[int64](12345), - IPv4Prefix: to.Ptr("10.18.0.0/17"), - IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/60"), - ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationPatchableProperties{ - InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationPatchableProperties{ - NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPatchablePropertiesOptionAProperties{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](10), - }, - Mtu: to.Ptr[int32](1501), - PeerASN: to.Ptr[int64](1235), - VlanID: to.Ptr[int32](3001), - }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10050")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionB), - }, - WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationPatchableProperties{ - NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPatchablePropertiesOptionAProperties{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](5), - }, - Mtu: to.Ptr[int32](1500), - PeerASN: to.Ptr[int64](61234), - VlanID: to.Ptr[int32](3000), - }, - OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - ExportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportRouteTargets: []*string{ - to.Ptr("65046:10050")}, - RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - ExportIPv4RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ExportIPv6RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportIPv4RouteTargets: []*string{ - to.Ptr("65046:10050")}, - ImportIPv6RouteTargets: []*string{ - to.Ptr("65046:10050")}, - }, - }, - PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - }, - }, - RackCount: to.Ptr[int32](6), - ServerCountPerRack: to.Ptr[int32](10), - TerminalServerConfiguration: &armmanagednetworkfabric.NetworkFabricPatchablePropertiesTerminalServerConfiguration{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - Password: to.Ptr("xxxxxxxx"), - SerialNumber: to.Ptr("1234567"), - Username: to.Ptr("username1"), - }, - }, - }, 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.NetworkFabric = armmanagednetworkfabric.NetworkFabric{ - // Name: to.Ptr("example-fabric"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("email@email.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FabricASN: to.Ptr[int64](12345), - // FabricVersion: to.Ptr("version1"), - // IPv4Prefix: to.Ptr("10.18.0.0/17"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/60"), - // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, - // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](10), - // }, - // Mtu: to.Ptr[int32](1501), - // PeerASN: to.Ptr[int64](1235), - // VlanID: to.Ptr[int32](3001), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionB), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](3000), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](6), - // Racks: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, - // RouterIDs: []*string{ - // to.Ptr("routerId")}, - // ServerCountPerRack: to.Ptr[int32](10), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // SerialNumber: to.Ptr("1234567"), - // Username: to.Ptr("username1"), - // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_Delete_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginDelete(ctx, "example-rg", "example-fabric", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFabricsClient().NewListByResourceGroupPager("example-rg", 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.NetworkFabricsListResult = armmanagednetworkfabric.NetworkFabricsListResult{ - // Value: []*armmanagednetworkfabric.NetworkFabric{ - // { - // Name: to.Ptr("example-fabric"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("email@email.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FabricASN: to.Ptr[int64](29249), - // FabricVersion: to.Ptr("version1"), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, - // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](10), - // }, - // Mtu: to.Ptr[int32](1501), - // PeerASN: to.Ptr[int64](1235), - // VlanID: to.Ptr[int32](3001), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](3000), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // Racks: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, - // RouterIDs: []*string{ - // to.Ptr("routerId")}, - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFabricsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkFabricsListResult = armmanagednetworkfabric.NetworkFabricsListResult{ - // Value: []*armmanagednetworkfabric.NetworkFabric{ - // { - // Name: to.Ptr("example-fabric"), - // Type: to.Ptr("Microsoft.ManagedNetworkFabric/networkFabrics"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("email@email.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("KeyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FabricASN: to.Ptr[int64](29249), - // FabricVersion: to.Ptr("version1"), - // IPv4Prefix: to.Ptr("10.18.0.0/19"), - // IPv6Prefix: to.Ptr("3FFE:FFFF:0:CD40::/59"), - // L2IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2Domain")}, - // L3IsolationDomains: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3Domain")}, - // ManagementNetworkConfiguration: &armmanagednetworkfabric.ManagementNetworkConfigurationProperties{ - // InfrastructureVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("20.0.0.13/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](10), - // }, - // Mtu: to.Ptr[int32](1501), - // PeerASN: to.Ptr[int64](1235), - // VlanID: to.Ptr[int32](3001), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // WorkloadVPNConfiguration: &armmanagednetworkfabric.VPNConfigurationProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // NetworkToNetworkInterconnectID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // OptionAProperties: &armmanagednetworkfabric.VPNConfigurationPropertiesOptionAProperties{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.14/30"), - // PrimaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::a7/126"), - // SecondaryIPv4Prefix: to.Ptr("10.0.0.15/30"), - // SecondaryIPv6Prefix: to.Ptr("2FFE:FFFF:0:CD30::ac/126"), - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](5), - // }, - // Mtu: to.Ptr[int32](1500), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](3000), - // }, - // OptionBProperties: &armmanagednetworkfabric.OptionBProperties{ - // ExportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportRouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // RouteTargets: &armmanagednetworkfabric.RouteTargetInformation{ - // ExportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ExportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv4RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // ImportIPv6RouteTargets: []*string{ - // to.Ptr("65046:10050")}, - // }, - // }, - // PeeringOption: to.Ptr(armmanagednetworkfabric.PeeringOptionOptionA), - // }, - // }, - // NetworkFabricControllerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabricControllers/example-fabricController"), - // NetworkFabricSKU: to.Ptr("M4-A400-A100-C16-aa"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // RackCount: to.Ptr[int32](4), - // Racks: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-networkRack")}, - // RouterIDs: []*string{ - // to.Ptr("routerId")}, - // ServerCountPerRack: to.Ptr[int32](8), - // TerminalServerConfiguration: &armmanagednetworkfabric.TerminalServerConfiguration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // SerialNumber: to.Ptr("123456"), - // Username: to.Ptr("username"), - // NetworkDeviceID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_provision_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginProvision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginProvision(ctx, "example-rg", "example-fabric", 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_deprovision_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginDeprovision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginDeprovision(ctx, "example-rg", "example-fabric", 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr("200"), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_upgrade_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginUpgrade(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateVersion{ - Version: to.Ptr("version1"), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_refreshConfiguration_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginRefreshConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginRefreshConfiguration(ctx, "example-rg", "example-fabric", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr("lvazqudujtegfmv"), - // }}, - // Code: to.Ptr("utdowavxlslkhmy"), - // Message: to.Ptr("otosyssdlaizpidtzcmiwvesc"), - // Target: to.Ptr("kht"), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateWorkloadManagementBfdConfiguration_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginUpdateWorkloadManagementBfdConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdateWorkloadManagementBfdConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_UpdateInfraManagementBfdConfiguration_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginUpdateInfraManagementBfdConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginUpdateInfraManagementBfdConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_ValidateConfiguration_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginValidateConfiguration(ctx, "example-rg", "example-fabric", armmanagednetworkfabric.ValidateConfigurationProperties{ - ValidateAction: to.Ptr(armmanagednetworkfabric.ValidateActionCabling), - }, 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_GetTopology_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginGetTopology() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginGetTopology(ctx, "example-rg", "example-fabric", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabrics_CommitConfiguration_MaximumSet_Gen.json -func ExampleNetworkFabricsClient_BeginCommitConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkFabricsClient().BeginCommitConfiguration(ctx, "example-rg", "example-fabric", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr("202"), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go index b50ad0cc5e64..c01e32b7c6fe 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_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 armmanagednetworkfabric @@ -51,18 +50,21 @@ func NewNetworkFabricSKUsClient(subscriptionID string, credential azcore.TokenCr // - networkFabricSKUName - Name of the Network Fabric SKU. // - options - NetworkFabricSKUsClientGetOptions contains the optional parameters for the NetworkFabricSKUsClient.Get method. func (client *NetworkFabricSKUsClient) Get(ctx context.Context, networkFabricSKUName string, options *NetworkFabricSKUsClientGetOptions) (NetworkFabricSKUsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, networkFabricSKUName, options) if err != nil { return NetworkFabricSKUsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkFabricSKUsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkFabricSKUsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkFabricSKUsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go deleted file mode 100644 index ef93e0b96179..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkfabricskus_client_example_test.go +++ /dev/null @@ -1,110 +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 armmanagednetworkfabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_Get_MaximumSet_Gen.json -func ExampleNetworkFabricSKUsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkFabricSKUsClient().Get(ctx, "example-fabricsku", 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.NetworkFabricSKU = armmanagednetworkfabric.NetworkFabricSKU{ - // Name: to.Ptr("example-fabricsku"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkFabricSkus"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/example-fabricsku"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), - // LastModifiedBy: to.Ptr("User@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricSKUProperties{ - // Type: to.Ptr(armmanagednetworkfabric.FabricSKUTypeSingleRack), - // MaxComputeRacks: to.Ptr[int32](4), - // MaximumServerCount: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SupportedVersions: []*string{ - // to.Ptr("1.0.0")}, - // Details: to.Ptr("https://azure/fabricskuDetails"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkFabricSkus_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkFabricSKUsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkFabricSKUsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkFabricSKUsListResult = armmanagednetworkfabric.NetworkFabricSKUsListResult{ - // Value: []*armmanagednetworkfabric.NetworkFabricSKU{ - // { - // Name: to.Ptr("example-fabricsku"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkFabricSkus"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/providers/Microsoft.ManagedNetworkFabric/networkFabricSkus/example-fabricsku"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:44:43.644Z"); return t}()), - // LastModifiedBy: to.Ptr("User@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkFabricSKUProperties{ - // Type: to.Ptr(armmanagednetworkfabric.FabricSKUTypeSingleRack), - // MaxComputeRacks: to.Ptr[int32](4), - // MaximumServerCount: to.Ptr[int32](9), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SupportedVersions: []*string{ - // to.Ptr("1.0.0")}, - // Details: to.Ptr("https://azure/fabricskuDetails"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go index aec44dd8d64d..768b79d488fc 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_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 armmanagednetworkfabric @@ -60,9 +59,10 @@ func (client *NetworkInterfacesClient) BeginCreate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkInterfacesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *NetworkInterfacesClient) BeginCreate(ctx context.Context, resource // // Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) create(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterface, options *NetworkInterfacesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,7 +113,10 @@ func (client *NetworkInterfacesClient) createCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the Network Interface resource. @@ -129,9 +134,10 @@ func (client *NetworkInterfacesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkInterfacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *NetworkInterfacesClient) BeginDelete(ctx context.Context, resource // // Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,18 +200,21 @@ func (client *NetworkInterfacesClient) deleteCreateRequest(ctx context.Context, // - networkInterfaceName - Name of the Network Interface. // - options - NetworkInterfacesClientGetOptions contains the optional parameters for the NetworkInterfacesClient.Get method. func (client *NetworkInterfacesClient) Get(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, options *NetworkInterfacesClientGetOptions) (NetworkInterfacesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, options) if err != nil { return NetworkInterfacesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkInterfacesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkInterfacesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkInterfacesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -325,9 +336,10 @@ func (client *NetworkInterfacesClient) BeginUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkInterfacesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -338,18 +350,20 @@ func (client *NetworkInterfacesClient) BeginUpdate(ctx context.Context, resource // // Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) update(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body NetworkInterfacePatch, options *NetworkInterfacesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -376,7 +390,10 @@ func (client *NetworkInterfacesClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Update the admin state of the Network Interface. @@ -395,9 +412,10 @@ func (client *NetworkInterfacesClient) BeginUpdateAdministrativeState(ctx contex if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkInterfacesClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkInterfacesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -408,18 +426,20 @@ func (client *NetworkInterfacesClient) BeginUpdateAdministrativeState(ctx contex // // Generated from API version 2023-06-15 func (client *NetworkInterfacesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkDeviceName string, networkInterfaceName string, body UpdateAdministrativeState, options *NetworkInterfacesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkDeviceName, networkInterfaceName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -446,5 +466,8 @@ func (client *NetworkInterfacesClient) updateAdministrativeStateCreateRequest(ct reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go deleted file mode 100644 index 238942c6cb3a..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkinterfaces_client_example_test.go +++ /dev/null @@ -1,280 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Create_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginCreate(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.NetworkInterface{ - Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - Annotation: to.Ptr("annotation"), - }, - }, 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.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("example-interface"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConnectedTo: to.Ptr("external-interface"), - // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), - // IPv4Address: to.Ptr("10.2.2.8"), - // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Id"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Get_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkInterfacesClient().Get(ctx, "example-rg", "example-device", "example-interface", 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.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("example-interface"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConnectedTo: to.Ptr("external-interface"), - // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), - // IPv4Address: to.Ptr("10.2.2.8"), - // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Id"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Update_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdate(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.NetworkInterfacePatch{ - Properties: &armmanagednetworkfabric.NetworkInterfacePatchProperties{ - Annotation: to.Ptr("annotation"), - }, - }, 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.NetworkInterface = armmanagednetworkfabric.NetworkInterface{ - // Name: to.Ptr("example-interface"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConnectedTo: to.Ptr("external-interface"), - // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), - // IPv4Address: to.Ptr("10.2.2.8"), - // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Id"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_Delete_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginDelete(ctx, "rgNetworkDevices", "sjzd", "emrgu", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_ListByNetworkDevice_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_NewListByNetworkDevicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkInterfacesClient().NewListByNetworkDevicePager("example-rg", "example-device", 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.NetworkInterfacesList = armmanagednetworkfabric.NetworkInterfacesList{ - // Value: []*armmanagednetworkfabric.NetworkInterface{ - // { - // Name: to.Ptr("example-interface"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkdevices/networkinterfaces"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-device/networkInterfaces/example-interface"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T16:02:19.538Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkInterfaceProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConnectedTo: to.Ptr("external-interface"), - // InterfaceType: to.Ptr(armmanagednetworkfabric.InterfaceTypeManagement), - // IPv4Address: to.Ptr("10.2.2.8"), - // IPv6Address: to.Ptr("10:2:0:0::"), - // PhysicalIdentifier: to.Ptr("Id"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkInterfaces_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkInterfacesClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-device", "example-interface", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go index 17cfe34768ca..8609052f2878 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NetworkPacketBrokersClient) BeginCreate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NetworkPacketBrokersClient) BeginCreate(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *NetworkPacketBrokersClient) create(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBroker, options *NetworkPacketBrokersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NetworkPacketBrokersClient) createCreateRequest(ctx context.Contex reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes Network Packet Broker. @@ -123,9 +128,10 @@ func (client *NetworkPacketBrokersClient) BeginDelete(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NetworkPacketBrokersClient) BeginDelete(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *NetworkPacketBrokersClient) deleteOperation(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,18 +190,21 @@ func (client *NetworkPacketBrokersClient) deleteCreateRequest(ctx context.Contex // - options - NetworkPacketBrokersClientGetOptions contains the optional parameters for the NetworkPacketBrokersClient.Get // method. func (client *NetworkPacketBrokersClient) Get(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, options *NetworkPacketBrokersClientGetOptions) (NetworkPacketBrokersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, options) if err != nil { return NetworkPacketBrokersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkPacketBrokersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkPacketBrokersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkPacketBrokersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -362,9 +373,10 @@ func (client *NetworkPacketBrokersClient) BeginUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkPacketBrokersClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkPacketBrokersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -375,18 +387,20 @@ func (client *NetworkPacketBrokersClient) BeginUpdate(ctx context.Context, resou // // Generated from API version 2023-06-15 func (client *NetworkPacketBrokersClient) update(ctx context.Context, resourceGroupName string, networkPacketBrokerName string, body NetworkPacketBrokerPatch, options *NetworkPacketBrokersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkPacketBrokerName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -409,5 +423,8 @@ func (client *NetworkPacketBrokersClient) updateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go deleted file mode 100644 index 81836c304c5d..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkpacketbrokers_client_example_test.go +++ /dev/null @@ -1,321 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Create_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginCreate(ctx, "example-rg", "example-networkPacketBroker", armmanagednetworkfabric.NetworkPacketBroker{ - Location: to.Ptr("eastuseuap"), - Tags: map[string]*string{ - "key2806": to.Ptr("key"), - }, - Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - }, - }, 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.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ - // Name: to.Ptr("example-networkPacketBroker"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key2806": to.Ptr("key"), - // }, - // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // NetworkDeviceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceInterfaceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Get_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkPacketBrokersClient().Get(ctx, "example-rg", "example-networkPacketBroker", 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.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ - // Name: to.Ptr("example-networkPacketBroker"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key2806": to.Ptr("key"), - // }, - // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // NetworkDeviceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceInterfaceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Update_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginUpdate(ctx, "example-rg", "example-networkPacketBroker", armmanagednetworkfabric.NetworkPacketBrokerPatch{ - Tags: map[string]*string{ - "key8772": to.Ptr("1234"), - }, - }, 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.NetworkPacketBroker = armmanagednetworkfabric.NetworkPacketBroker{ - // Name: to.Ptr("example-networkPacketBroker"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key8772": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // NetworkDeviceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceInterfaceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_Delete_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkPacketBrokersClient().BeginDelete(ctx, "example-rg", "example-networkPacketBroker", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkPacketBrokersClient().NewListByResourceGroupPager("example-rg", 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.NetworkPacketBrokersListResult = armmanagednetworkfabric.NetworkPacketBrokersListResult{ - // Value: []*armmanagednetworkfabric.NetworkPacketBroker{ - // { - // Name: to.Ptr("example-networkPacketBroker"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key2806": to.Ptr("key"), - // }, - // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // NetworkDeviceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceInterfaceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkPacketBrokers_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkPacketBrokersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkPacketBrokersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkPacketBrokersListResult = armmanagednetworkfabric.NetworkPacketBrokersListResult{ - // Value: []*armmanagednetworkfabric.NetworkPacketBroker{ - // { - // Name: to.Ptr("example-networkPacketBroker"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkPacketBrokers"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-17T11:56:12.100Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key2806": to.Ptr("key"), - // }, - // Properties: &armmanagednetworkfabric.NetworkPacketBrokerProperties{ - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // NetworkDeviceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkTapIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap")}, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceInterfaceIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go index a70356175031..5a30405bd432 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NetworkRacksClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkRacksClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NetworkRacksClient) BeginCreate(ctx context.Context, resourceGroup // // Generated from API version 2023-06-15 func (client *NetworkRacksClient) create(ctx context.Context, resourceGroupName string, networkRackName string, body NetworkRack, options *NetworkRacksClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkRackName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NetworkRacksClient) createCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Network Rack resource. @@ -123,9 +128,10 @@ func (client *NetworkRacksClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkRacksClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NetworkRacksClient) BeginDelete(ctx context.Context, resourceGroup // // Generated from API version 2023-06-15 func (client *NetworkRacksClient) deleteOperation(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkRackName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *NetworkRacksClient) deleteCreateRequest(ctx context.Context, resou // - networkRackName - Name of the Network Rack. // - options - NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. func (client *NetworkRacksClient) Get(ctx context.Context, resourceGroupName string, networkRackName string, options *NetworkRacksClientGetOptions) (NetworkRacksClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkRackName, options) if err != nil { return NetworkRacksClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkRacksClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkRacksClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkRacksClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -361,9 +372,10 @@ func (client *NetworkRacksClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkRacksClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkRacksClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,18 +386,20 @@ func (client *NetworkRacksClient) BeginUpdate(ctx context.Context, resourceGroup // // Generated from API version 2023-06-15 func (client *NetworkRacksClient) update(ctx context.Context, resourceGroupName string, networkRackName string, body TagsUpdate, options *NetworkRacksClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkRackName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -408,5 +422,8 @@ func (client *NetworkRacksClient) updateCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go deleted file mode 100644 index e427701e45e5..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networkracks_client_example_test.go +++ /dev/null @@ -1,303 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Create_MaximumSet_Gen.json -func ExampleNetworkRacksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkRacksClient().BeginCreate(ctx, "example-rg", "example-rack", armmanagednetworkfabric.NetworkRack{ - Location: to.Ptr("eastuseuap"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkRackProperties{ - Annotation: to.Ptr("annotation"), - NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - }, - }, 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.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("example-rack"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // LastModifiedBy: to.Ptr("user@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("annotation"), - // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Get_MaximumSet_Gen.json -func ExampleNetworkRacksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkRacksClient().Get(ctx, "example-rg", "example-rack", 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.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("example-rack"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // LastModifiedBy: to.Ptr("user@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("annotation"), - // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Update_MaximumSet_Gen.json -func ExampleNetworkRacksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkRacksClient().BeginUpdate(ctx, "example-rg", "example-rack", armmanagednetworkfabric.TagsUpdate{ - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - }, 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.NetworkRack = armmanagednetworkfabric.NetworkRack{ - // Name: to.Ptr("example-rack"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // LastModifiedBy: to.Ptr("user@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("annotation"), - // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_Delete_MaximumSet_Gen.json -func ExampleNetworkRacksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkRacksClient().BeginDelete(ctx, "example-rg", "example-rack", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkRacksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkRacksClient().NewListByResourceGroupPager("example-rg", 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.NetworkRacksListResult = armmanagednetworkfabric.NetworkRacksListResult{ - // Value: []*armmanagednetworkfabric.NetworkRack{ - // { - // Name: to.Ptr("example-rack"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // LastModifiedBy: to.Ptr("user@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("annotation"), - // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkRacks_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkRacksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkRacksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkRacksListResult = armmanagednetworkfabric.NetworkRacksListResult{ - // Value: []*armmanagednetworkfabric.NetworkRack{ - // { - // Name: to.Ptr("example-rack"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkRacks"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkRacks/example-rack"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T06:00:50.441Z"); return t}()), - // LastModifiedBy: to.Ptr("user@email.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkRackProperties{ - // Annotation: to.Ptr("annotation"), - // NetworkDevices: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice")}, - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-networkFabric"), - // NetworkRackType: to.Ptr(armmanagednetworkfabric.NetworkRackTypeAggregate), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go index df2f91064257..0729fea748ba 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_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 armmanagednetworkfabric @@ -59,9 +58,10 @@ func (client *NetworkTapRulesClient) BeginCreate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *NetworkTapRulesClient) BeginCreate(ctx context.Context, resourceGr // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) create(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRule, options *NetworkTapRulesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,7 +108,10 @@ func (client *NetworkTapRulesClient) createCreateRequest(ctx context.Context, re reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete Network Tap Rule resource. @@ -123,9 +128,10 @@ func (client *NetworkTapRulesClient) BeginDelete(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *NetworkTapRulesClient) BeginDelete(ctx context.Context, resourceGr // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkTapRuleName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,18 +189,21 @@ func (client *NetworkTapRulesClient) deleteCreateRequest(ctx context.Context, re // - networkTapRuleName - Name of the Network Tap Rule. // - options - NetworkTapRulesClientGetOptions contains the optional parameters for the NetworkTapRulesClient.Get method. func (client *NetworkTapRulesClient) Get(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientGetOptions) (NetworkTapRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkTapRuleName, options) if err != nil { return NetworkTapRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkTapRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkTapRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkTapRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -360,9 +371,10 @@ func (client *NetworkTapRulesClient) BeginResync(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientResyncResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientResyncResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -373,18 +385,20 @@ func (client *NetworkTapRulesClient) BeginResync(ctx context.Context, resourceGr // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) resync(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginResyncOptions) (*http.Response, error) { + var err error req, err := client.resyncCreateRequest(ctx, resourceGroupName, networkTapRuleName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncCreateRequest creates the Resync request. @@ -425,9 +439,10 @@ func (client *NetworkTapRulesClient) BeginUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -438,18 +453,20 @@ func (client *NetworkTapRulesClient) BeginUpdate(ctx context.Context, resourceGr // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) update(ctx context.Context, resourceGroupName string, networkTapRuleName string, body NetworkTapRulePatch, options *NetworkTapRulesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -472,7 +489,10 @@ func (client *NetworkTapRulesClient) updateCreateRequest(ctx context.Context, re reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Implements the operation to the underlying resources. @@ -490,9 +510,10 @@ func (client *NetworkTapRulesClient) BeginUpdateAdministrativeState(ctx context. if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -503,18 +524,20 @@ func (client *NetworkTapRulesClient) BeginUpdateAdministrativeState(ctx context. // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapRuleName string, body UpdateAdministrativeState, options *NetworkTapRulesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkTapRuleName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -537,7 +560,10 @@ func (client *NetworkTapRulesClient) updateAdministrativeStateCreateRequest(ctx reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Implements the operation to the underlying resources. @@ -554,9 +580,10 @@ func (client *NetworkTapRulesClient) BeginValidateConfiguration(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapRulesClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapRulesClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -567,18 +594,20 @@ func (client *NetworkTapRulesClient) BeginValidateConfiguration(ctx context.Cont // // Generated from API version 2023-06-15 func (client *NetworkTapRulesClient) validateConfiguration(ctx context.Context, resourceGroupName string, networkTapRuleName string, options *NetworkTapRulesClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, networkTapRuleName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go deleted file mode 100644 index ba59eb40474c..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaprules_client_example_test.go +++ /dev/null @@ -1,953 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Create_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginCreate(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.NetworkTapRule{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - Annotation: to.Ptr("annotation"), - ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - { - IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - { - Name: to.Ptr("example-ipGroup1"), - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - IPPrefixes: []*string{ - to.Ptr("10.10.10.10/30")}, - }}, - PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - { - Name: to.Ptr("example-portGroup1"), - Ports: []*string{ - to.Ptr("100-200")}, - }, - { - Name: to.Ptr("example-portGroup2"), - Ports: []*string{ - to.Ptr("900"), - to.Ptr("1000-2000")}, - }}, - VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - { - Name: to.Ptr("exmaple-vlanGroup"), - Vlans: []*string{ - to.Ptr("10"), - to.Ptr("100-200")}, - }}, - }}, - MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - { - Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - { - Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), - DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - MatchConfigurationName: to.Ptr("match1"), - Truncate: to.Ptr("100"), - }}, - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - { - IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - IPGroupNames: []*string{ - to.Ptr("example-ipGroup")}, - IPPrefixValues: []*string{ - to.Ptr("10.10.10.10/20")}, - PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - }, - ProtocolTypes: []*string{ - to.Ptr("TCP")}, - VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - InnerVlans: []*string{ - to.Ptr("11-20")}, - VlanGroupNames: []*string{ - to.Ptr("exmaple-vlanGroup")}, - Vlans: []*string{ - to.Ptr("10")}, - }, - EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - PortCondition: &armmanagednetworkfabric.PortCondition{ - Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - PortGroupNames: []*string{ - to.Ptr("example-portGroup1")}, - PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - Ports: []*string{ - to.Ptr("100")}, - }, - }}, - MatchConfigurationName: to.Ptr("config1"), - SequenceNumber: to.Ptr[int64](10), - }}, - TapRulesURL: to.Ptr("https://microsoft.com/a"), - PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - }, - }, 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.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ - // Name: to.Ptr("example-tapRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - // Annotation: to.Ptr("annotation"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup1"), - // IPPrefixes: []*string{ - // to.Ptr("10.10.10.10/30")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup1"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }, - // { - // Name: to.Ptr("example-portGroup2"), - // Ports: []*string{ - // to.Ptr("900"), - // to.Ptr("1000-2000")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("exmaple-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("10"), - // to.Ptr("100-200")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // MatchConfigurationName: to.Ptr("match1"), - // Truncate: to.Ptr("100"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.10.10.10/20")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("11-20")}, - // VlanGroupNames: []*string{ - // to.Ptr("exmaple-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("10")}, - // }, - // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - // PortCondition: &armmanagednetworkfabric.PortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup1")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("100")}, - // }, - // }}, - // MatchConfigurationName: to.Ptr("config1"), - // SequenceNumber: to.Ptr[int64](10), - // }}, - // TapRulesURL: to.Ptr("https://microsoft.com/a"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), - // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), - // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Get_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkTapRulesClient().Get(ctx, "example-rg", "example-tapRule", 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.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ - // Name: to.Ptr("example-tapRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - // Annotation: to.Ptr("annotation"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup1"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.10.10.10/30")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup1"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }, - // { - // Name: to.Ptr("example-portGroup2"), - // Ports: []*string{ - // to.Ptr("900"), - // to.Ptr("1000-2000")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("exmaple-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("10"), - // to.Ptr("100-200")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // MatchConfigurationName: to.Ptr("match1"), - // Truncate: to.Ptr("100"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.10.10.10/20")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("11-20")}, - // VlanGroupNames: []*string{ - // to.Ptr("exmaple-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("10")}, - // }, - // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - // PortCondition: &armmanagednetworkfabric.PortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup1")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("100")}, - // }, - // }}, - // MatchConfigurationName: to.Ptr("config1"), - // SequenceNumber: to.Ptr[int64](10), - // }}, - // TapRulesURL: to.Ptr("https://microsoft.com/a"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), - // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), - // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Update_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginUpdate(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.NetworkTapRulePatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.NetworkTapRulePatchProperties{ - Annotation: to.Ptr("annotation"), - ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - { - IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - { - Name: to.Ptr("example-ipGroup1"), - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - IPPrefixes: []*string{ - to.Ptr("10.10.10.10/30")}, - }}, - PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - { - Name: to.Ptr("example-portGroup1"), - Ports: []*string{ - to.Ptr("100-200")}, - }}, - VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - { - Name: to.Ptr("exmaple-vlanGroup"), - Vlans: []*string{ - to.Ptr("10"), - to.Ptr("100-200")}, - }}, - }}, - MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - { - Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - { - Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeGoto), - DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - MatchConfigurationName: to.Ptr("match1"), - Truncate: to.Ptr("100"), - }}, - IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - { - IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - IPGroupNames: []*string{ - to.Ptr("example-ipGroup")}, - IPPrefixValues: []*string{ - to.Ptr("10.10.10.10/20")}, - PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - }, - ProtocolTypes: []*string{ - to.Ptr("TCP")}, - VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - InnerVlans: []*string{ - to.Ptr("11-20")}, - VlanGroupNames: []*string{ - to.Ptr("exmaple-vlanGroup")}, - Vlans: []*string{ - to.Ptr("10")}, - }, - EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - PortCondition: &armmanagednetworkfabric.PortCondition{ - Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - PortGroupNames: []*string{ - to.Ptr("example-portGroup1")}, - PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - Ports: []*string{ - to.Ptr("100")}, - }, - }}, - MatchConfigurationName: to.Ptr("config1"), - SequenceNumber: to.Ptr[int64](10), - }}, - TapRulesURL: to.Ptr("https://microsoft.com/amdsdx"), - }, - }, 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.NetworkTapRule = armmanagednetworkfabric.NetworkTapRule{ - // Name: to.Ptr("example-tapRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - // Annotation: to.Ptr("annotation"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup1"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.10.10.10/30")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup1"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }, - // { - // Name: to.Ptr("example-portGroup2"), - // Ports: []*string{ - // to.Ptr("900"), - // to.Ptr("1000-2000")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("exmaple-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("10"), - // to.Ptr("100-200")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeGoto), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // MatchConfigurationName: to.Ptr("match1"), - // Truncate: to.Ptr("100"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.10.10.10/20")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("11-20")}, - // VlanGroupNames: []*string{ - // to.Ptr("exmaple-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("10")}, - // }, - // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - // PortCondition: &armmanagednetworkfabric.PortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup1")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("100")}, - // }, - // }}, - // MatchConfigurationName: to.Ptr("config1"), - // SequenceNumber: to.Ptr[int64](10), - // }}, - // TapRulesURL: to.Ptr("https://microsoft.com/a"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), - // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), - // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Delete_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginDelete(ctx, "example-rg", "example-tapRule", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkTapRulesClient().NewListByResourceGroupPager("example-rg", 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.NetworkTapRulesListResult = armmanagednetworkfabric.NetworkTapRulesListResult{ - // Value: []*armmanagednetworkfabric.NetworkTapRule{ - // { - // Name: to.Ptr("example-tapRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - // Annotation: to.Ptr("annotation"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup1"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.10.10.10/30")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup1"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }, - // { - // Name: to.Ptr("example-portGroup2"), - // Ports: []*string{ - // to.Ptr("900"), - // to.Ptr("1000-2000")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("exmaple-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("10"), - // to.Ptr("100-200")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // MatchConfigurationName: to.Ptr("match1"), - // Truncate: to.Ptr("100"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.10.10.10/20")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("11-20")}, - // VlanGroupNames: []*string{ - // to.Ptr("exmaple-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("10")}, - // }, - // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - // PortCondition: &armmanagednetworkfabric.PortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup1")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("100")}, - // }, - // }}, - // MatchConfigurationName: to.Ptr("yvtpdqhqc"), - // SequenceNumber: to.Ptr[int64](3649377483), - // }}, - // TapRulesURL: to.Ptr("https://microsoft.com/a"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), - // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), - // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkTapRulesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkTapRulesListResult = armmanagednetworkfabric.NetworkTapRulesListResult{ - // Value: []*armmanagednetworkfabric.NetworkTapRule{ - // { - // Name: to.Ptr("example-tapRule"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTapRules"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-tapRule"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.488Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapRuleProperties{ - // Annotation: to.Ptr("annotation"), - // ConfigurationType: to.Ptr(armmanagednetworkfabric.ConfigurationTypeFile), - // DynamicMatchConfigurations: []*armmanagednetworkfabric.CommonDynamicMatchConfiguration{ - // { - // IPGroups: []*armmanagednetworkfabric.IPGroupProperties{ - // { - // Name: to.Ptr("example-ipGroup1"), - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // IPPrefixes: []*string{ - // to.Ptr("10.10.10.10/30")}, - // }}, - // PortGroups: []*armmanagednetworkfabric.PortGroupProperties{ - // { - // Name: to.Ptr("example-portGroup1"), - // Ports: []*string{ - // to.Ptr("100-200")}, - // }, - // { - // Name: to.Ptr("example-portGroup2"), - // Ports: []*string{ - // to.Ptr("900"), - // to.Ptr("1000-2000")}, - // }}, - // VlanGroups: []*armmanagednetworkfabric.VlanGroupProperties{ - // { - // Name: to.Ptr("exmaple-vlanGroup"), - // Vlans: []*string{ - // to.Ptr("10"), - // to.Ptr("100-200")}, - // }}, - // }}, - // MatchConfigurations: []*armmanagednetworkfabric.NetworkTapRuleMatchConfiguration{ - // { - // Actions: []*armmanagednetworkfabric.NetworkTapRuleAction{ - // { - // Type: to.Ptr(armmanagednetworkfabric.TapRuleActionTypeDrop), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup"), - // IsTimestampEnabled: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // MatchConfigurationName: to.Ptr("match1"), - // Truncate: to.Ptr("100"), - // }}, - // IPAddressType: to.Ptr(armmanagednetworkfabric.IPAddressTypeIPv4), - // MatchConditions: []*armmanagednetworkfabric.NetworkTapRuleMatchCondition{ - // { - // IPCondition: &armmanagednetworkfabric.IPMatchCondition{ - // Type: to.Ptr(armmanagednetworkfabric.SourceDestinationTypeSourceIP), - // IPGroupNames: []*string{ - // to.Ptr("example-ipGroup")}, - // IPPrefixValues: []*string{ - // to.Ptr("10.10.10.10/20")}, - // PrefixType: to.Ptr(armmanagednetworkfabric.PrefixTypePrefix), - // }, - // ProtocolTypes: []*string{ - // to.Ptr("TCP")}, - // VlanMatchCondition: &armmanagednetworkfabric.VlanMatchCondition{ - // InnerVlans: []*string{ - // to.Ptr("11-20")}, - // VlanGroupNames: []*string{ - // to.Ptr("exmaple-vlanGroup")}, - // Vlans: []*string{ - // to.Ptr("10")}, - // }, - // EncapsulationType: to.Ptr(armmanagednetworkfabric.EncapsulationTypeNone), - // PortCondition: &armmanagednetworkfabric.PortCondition{ - // Layer4Protocol: to.Ptr(armmanagednetworkfabric.Layer4ProtocolTCP), - // PortGroupNames: []*string{ - // to.Ptr("example-portGroup1")}, - // PortType: to.Ptr(armmanagednetworkfabric.PortTypeSourcePort), - // Ports: []*string{ - // to.Ptr("100")}, - // }, - // }}, - // MatchConfigurationName: to.Ptr("config1"), - // SequenceNumber: to.Ptr[int64](10), - // }}, - // TapRulesURL: to.Ptr("https://microsoft.com/a"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // LastSyncedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-12T07:11:22.485Z"); return t}()), - // NetworkTapID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-tap"), - // PollingIntervalInSeconds: to.Ptr(armmanagednetworkfabric.PollingIntervalInSeconds(30)), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-tapRule", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_Resync_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginResync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginResync(ctx, "example-rg", "example-tapRule", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTapRules_ValidateConfiguration_MaximumSet_Gen.json -func ExampleNetworkTapRulesClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapRulesClient().BeginValidateConfiguration(ctx, "example-rg", "example-tapRule", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ActionDetails"), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go index a80cd642be17..3b185729b794 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *NetworkTapsClient) BeginCreate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *NetworkTapsClient) BeginCreate(ctx context.Context, resourceGroupN // // Generated from API version 2023-06-15 func (client *NetworkTapsClient) create(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTap, options *NetworkTapsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkTapName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -105,7 +107,10 @@ func (client *NetworkTapsClient) createCreateRequest(ctx context.Context, resour reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes Network Tap. @@ -121,9 +126,10 @@ func (client *NetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,18 +140,20 @@ func (client *NetworkTapsClient) BeginDelete(ctx context.Context, resourceGroupN // // Generated from API version 2023-06-15 func (client *NetworkTapsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkTapName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,18 +187,21 @@ func (client *NetworkTapsClient) deleteCreateRequest(ctx context.Context, resour // - networkTapName - Name of the Network Tap. // - options - NetworkTapsClientGetOptions contains the optional parameters for the NetworkTapsClient.Get method. func (client *NetworkTapsClient) Get(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientGetOptions) (NetworkTapsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkTapName, options) if err != nil { return NetworkTapsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkTapsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkTapsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkTapsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -357,9 +368,10 @@ func (client *NetworkTapsClient) BeginResync(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientResyncResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientResyncResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapsClientResyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -370,18 +382,20 @@ func (client *NetworkTapsClient) BeginResync(ctx context.Context, resourceGroupN // // Generated from API version 2023-06-15 func (client *NetworkTapsClient) resync(ctx context.Context, resourceGroupName string, networkTapName string, options *NetworkTapsClientBeginResyncOptions) (*http.Response, error) { + var err error req, err := client.resyncCreateRequest(ctx, resourceGroupName, networkTapName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncCreateRequest creates the Resync request. @@ -421,9 +435,10 @@ func (client *NetworkTapsClient) BeginUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -434,18 +449,20 @@ func (client *NetworkTapsClient) BeginUpdate(ctx context.Context, resourceGroupN // // Generated from API version 2023-06-15 func (client *NetworkTapsClient) update(ctx context.Context, resourceGroupName string, networkTapName string, body NetworkTapPatch, options *NetworkTapsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkTapName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -468,7 +485,10 @@ func (client *NetworkTapsClient) updateCreateRequest(ctx context.Context, resour reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Implements the operation to the underlying resources. @@ -486,9 +506,10 @@ func (client *NetworkTapsClient) BeginUpdateAdministrativeState(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkTapsClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkTapsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -499,18 +520,20 @@ func (client *NetworkTapsClient) BeginUpdateAdministrativeState(ctx context.Cont // // Generated from API version 2023-06-15 func (client *NetworkTapsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkTapName string, body UpdateAdministrativeState, options *NetworkTapsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkTapName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -533,5 +556,8 @@ func (client *NetworkTapsClient) updateAdministrativeStateCreateRequest(ctx cont reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go deleted file mode 100644 index 0d913bdb663e..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktaps_client_example_test.go +++ /dev/null @@ -1,484 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Create_MaximumSet_Gen.json -func ExampleNetworkTapsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapsClient().BeginCreate(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.NetworkTap{ - Location: to.Ptr("eastuseuap"), - Tags: map[string]*string{ - "key6024": to.Ptr("1234"), - }, - Properties: &armmanagednetworkfabric.NetworkTapProperties{ - Annotation: to.Ptr("annotation"), - Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - { - Name: to.Ptr("example-destinaionName"), - DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - NeighborGroupIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - }, - }}, - NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - }, - }, 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.NetworkTap = armmanagednetworkfabric.NetworkTap{ - // Name: to.Ptr("example-networkTap"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), - // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key6024": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - // { - // Name: to.Ptr("example-destinaionName"), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // }, - // }}, - // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Get_MaximumSet_Gen.json -func ExampleNetworkTapsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkTapsClient().Get(ctx, "example-rg", "example-networkTap", 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.NetworkTap = armmanagednetworkfabric.NetworkTap{ - // Name: to.Ptr("example-networkTap"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), - // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key6024": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - // { - // Name: to.Ptr("example-destinaionName"), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // }, - // }}, - // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Update_MaximumSet_Gen.json -func ExampleNetworkTapsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapsClient().BeginUpdate(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.NetworkTapPatch{ - Tags: map[string]*string{ - "key6024": to.Ptr("1234"), - }, - Properties: &armmanagednetworkfabric.NetworkTapPatchableParameters{ - Annotation: to.Ptr("annotation1"), - Destinations: []*armmanagednetworkfabric.NetworkTapPatchableParametersDestinationsItem{ - { - Name: to.Ptr("example-destinaionName"), - DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - NeighborGroupIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - }, - }}, - PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - }, - }, 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.NetworkTap = armmanagednetworkfabric.NetworkTap{ - // Name: to.Ptr("example-networkTap"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), - // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key6024": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapProperties{ - // Annotation: to.Ptr("annotation1"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - // { - // Name: to.Ptr("example-destinaionName"), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // }, - // }}, - // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Delete_MaximumSet_Gen.json -func ExampleNetworkTapsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapsClient().BeginDelete(ctx, "example-rg", "example-networkTap", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListByResourceGroup_MaximumSet_Gen.json -func ExampleNetworkTapsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkTapsClient().NewListByResourceGroupPager("example-rg", 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.NetworkTapsListResult = armmanagednetworkfabric.NetworkTapsListResult{ - // Value: []*armmanagednetworkfabric.NetworkTap{ - // { - // Name: to.Ptr("example-networkTap"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), - // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key6024": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - // { - // Name: to.Ptr("example-destinaionName"), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // }, - // }}, - // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_ListBySubscription_MaximumSet_Gen.json -func ExampleNetworkTapsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkTapsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkTapsListResult = armmanagednetworkfabric.NetworkTapsListResult{ - // Value: []*armmanagednetworkfabric.NetworkTap{ - // { - // Name: to.Ptr("example-networkTap"), - // Type: to.Ptr("microsoft.managednetworkfabric/networkTaps"), - // ID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTaps/example-networkTap"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.578Z"); return t}()), - // CreatedBy: to.Ptr("email@address.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-08T16:02:57.579Z"); return t}()), - // LastModifiedBy: to.Ptr("email@address.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastuseuap"), - // Tags: map[string]*string{ - // "key6024": to.Ptr("1234"), - // }, - // Properties: &armmanagednetworkfabric.NetworkTapProperties{ - // Annotation: to.Ptr("annotation"), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // Destinations: []*armmanagednetworkfabric.NetworkTapPropertiesDestinationsItem{ - // { - // Name: to.Ptr("example-destinaionName"), - // DestinationID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/l3IsloationDomains/example-l3Domain/internalNetworks/example-internalNetwork"), - // DestinationTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-destinationTapRule"), - // DestinationType: to.Ptr(armmanagednetworkfabric.DestinationTypeIsolationDomain), - // IsolationDomainProperties: &armmanagednetworkfabric.IsolationDomainProperties{ - // Encapsulation: to.Ptr(armmanagednetworkfabric.EncapsulationNone), - // NeighborGroupIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/neighborGroups/example-neighborGroup")}, - // }, - // }}, - // NetworkPacketBrokerID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkPacketBrokers/example-networkPacketBroker"), - // PollingType: to.Ptr(armmanagednetworkfabric.PollingTypePull), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // SourceTapRuleID: to.Ptr("/subscriptions/xxxx-xxxx-xxxx-xxxx/resourcegroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkTapRules/example-sourceTapRule"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkTapsClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-networkTap", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkTaps_Resync_MaximumSet_Gen.json -func ExampleNetworkTapsClient_BeginResync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkTapsClient().BeginResync(ctx, "example-rg", "example-networkTap", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go index bf44b4a9ec43..527912228a61 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_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 armmanagednetworkfabric @@ -60,9 +59,10 @@ func (client *NetworkToNetworkInterconnectsClient) BeginCreate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,18 +73,20 @@ func (client *NetworkToNetworkInterconnectsClient) BeginCreate(ctx context.Conte // // Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) create(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnect, options *NetworkToNetworkInterconnectsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,7 +113,10 @@ func (client *NetworkToNetworkInterconnectsClient) createCreateRequest(ctx conte reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements NetworkToNetworkInterconnects DELETE method. @@ -129,9 +134,10 @@ func (client *NetworkToNetworkInterconnectsClient) BeginDelete(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,18 +148,20 @@ func (client *NetworkToNetworkInterconnectsClient) BeginDelete(ctx context.Conte // // Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -193,18 +201,21 @@ func (client *NetworkToNetworkInterconnectsClient) deleteCreateRequest(ctx conte // - options - NetworkToNetworkInterconnectsClientGetOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.Get // method. func (client *NetworkToNetworkInterconnectsClient) Get(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, options *NetworkToNetworkInterconnectsClientGetOptions) (NetworkToNetworkInterconnectsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, options) if err != nil { return NetworkToNetworkInterconnectsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkToNetworkInterconnectsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkToNetworkInterconnectsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkToNetworkInterconnectsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -326,9 +337,10 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -339,18 +351,20 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdate(ctx context.Conte // // Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) update(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body NetworkToNetworkInterconnectPatch, options *NetworkToNetworkInterconnectsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -377,7 +391,10 @@ func (client *NetworkToNetworkInterconnectsClient) updateCreateRequest(ctx conte reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Updates the Admin State. @@ -396,9 +413,10 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdateAdministrativeStat if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -409,18 +427,20 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdateAdministrativeStat // // Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -447,7 +467,10 @@ func (client *NetworkToNetworkInterconnectsClient) updateAdministrativeStateCrea reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateNpbStaticRouteBfdAdministrativeState - Updates the NPB Static Route BFD Administrative State. @@ -466,9 +489,10 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdateNpbStaticRouteBfdA if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -479,18 +503,20 @@ func (client *NetworkToNetworkInterconnectsClient) BeginUpdateNpbStaticRouteBfdA // // Generated from API version 2023-06-15 func (client *NetworkToNetworkInterconnectsClient) updateNpbStaticRouteBfdAdministrativeState(ctx context.Context, resourceGroupName string, networkFabricName string, networkToNetworkInterconnectName string, body UpdateAdministrativeState, options *NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateNpbStaticRouteBfdAdministrativeStateCreateRequest(ctx, resourceGroupName, networkFabricName, networkToNetworkInterconnectName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateNpbStaticRouteBfdAdministrativeStateCreateRequest creates the UpdateNpbStaticRouteBfdAdministrativeState request. @@ -517,5 +543,8 @@ func (client *NetworkToNetworkInterconnectsClient) updateNpbStaticRouteBfdAdmini reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go deleted file mode 100644 index 1fda7c65b30d..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/networktonetworkinterconnects_client_example_test.go +++ /dev/null @@ -1,571 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Create_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginCreate(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.NetworkToNetworkInterconnect{ - Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - }, - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - }, - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), - Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - Interfaces: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - Mtu: to.Ptr[int32](1500), - }, - NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](300), - Multiplier: to.Ptr[int32](25), - }, - IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("21.20.20.20")}, - Prefix: to.Ptr("20.0.0.12/30"), - }}, - IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("4FFE:FFFF:0:CD30::ac")}, - Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), - }}, - }, - OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ - PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - PeerASN: to.Ptr[int64](61234), - VlanID: to.Ptr[int32](1234), - }, - UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - }, - }, 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.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // Name: to.Ptr("example-nni"), - // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), - // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - // Interfaces: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // Mtu: to.Ptr[int32](1500), - // }, - // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](25), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("21.20.20.20")}, - // Prefix: to.Ptr("20.0.0.12/30"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("4FFE:FFFF:0:CD30::ac")}, - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), - // }}, - // }, - // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // FabricASN: to.Ptr[int64](17), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](1234), - // }, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Get_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkToNetworkInterconnectsClient().Get(ctx, "example-rg", "example-fabric", "example-nni", 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.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // Name: to.Ptr("example-nni"), - // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), - // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - // Interfaces: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // Mtu: to.Ptr[int32](1500), - // }, - // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](25), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("21.20.20.20")}, - // Prefix: to.Ptr("20.0.0.12/30"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("4FFE:FFFF:0:CD30::ac")}, - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), - // }}, - // }, - // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // FabricASN: to.Ptr[int64](17), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](1234), - // }, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Update_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdate(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.NetworkToNetworkInterconnectPatch{ - Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectPatchableProperties{ - EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - }, - ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy1"), - }, - IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - Interfaces: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - Mtu: to.Ptr[int32](1500), - }, - NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - IntervalInMilliSeconds: to.Ptr[int32](310), - Multiplier: to.Ptr[int32](15), - }, - IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("21.20.20.10")}, - Prefix: to.Ptr("20.0.0.11/30"), - }}, - IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - { - NextHop: []*string{ - to.Ptr("5FFE:FFFF:0:CD30::ac")}, - Prefix: to.Ptr("4FFE:FFFF:0:CD30::ac/127"), - }}, - }, - OptionBLayer3Configuration: &armmanagednetworkfabric.OptionBLayer3Configuration{ - PrimaryIPv4Prefix: to.Ptr("20.0.0.12/29"), - PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - SecondaryIPv4Prefix: to.Ptr("20.0.0.14/29"), - SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - PeerASN: to.Ptr[int64](2345), - VlanID: to.Ptr[int32](1235), - }, - }, - }, 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.NetworkToNetworkInterconnect = armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // Name: to.Ptr("example-nni"), - // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), - // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - // Interfaces: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // Mtu: to.Ptr[int32](1500), - // }, - // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](25), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("21.20.20.20")}, - // Prefix: to.Ptr("20.0.0.12/30"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("4FFE:FFFF:0:CD30::ac")}, - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), - // }}, - // }, - // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // FabricASN: to.Ptr[int64](17), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](1234), - // }, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_Delete_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginDelete(ctx, "example-rg", "example-fabric", "example-nni", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_ListByNetworkFabric_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_NewListByNetworkFabricPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkToNetworkInterconnectsClient().NewListByNetworkFabricPager("example-rg", "example-fabric", 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.NetworkToNetworkInterconnectsList = armmanagednetworkfabric.NetworkToNetworkInterconnectsList{ - // Value: []*armmanagednetworkfabric.NetworkToNetworkInterconnect{ - // { - // Name: to.Ptr("example-nni"), - // Type: to.Ptr("microsoft.managedNetworkFabric/networkFabrics/networkToNetworkInterconnects"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric/networkToNetworkInterconnects/example-nni"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-07T09:53:31.314Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Properties: &armmanagednetworkfabric.NetworkToNetworkInterconnectProperties{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // EgressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // ExportRoutePolicy: &armmanagednetworkfabric.ExportRoutePolicyInformation{ - // ExportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ExportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // ImportRoutePolicy: &armmanagednetworkfabric.ImportRoutePolicyInformation{ - // ImportIPv4RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // ImportIPv6RoutePolicyID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // }, - // IngressACLID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-acl"), - // IsManagementType: to.Ptr(armmanagednetworkfabric.IsManagementTypeTrue), - // Layer2Configuration: &armmanagednetworkfabric.Layer2Configuration{ - // Interfaces: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-networkInterface")}, - // Mtu: to.Ptr[int32](1500), - // }, - // NniType: to.Ptr(armmanagednetworkfabric.NniTypeCE), - // NpbStaticRouteConfiguration: &armmanagednetworkfabric.NpbStaticRouteConfiguration{ - // BfdConfiguration: &armmanagednetworkfabric.BfdConfiguration{ - // AdministrativeState: to.Ptr(armmanagednetworkfabric.BfdAdministrativeStateEnabled), - // IntervalInMilliSeconds: to.Ptr[int32](300), - // Multiplier: to.Ptr[int32](25), - // }, - // IPv4Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("21.20.20.20")}, - // Prefix: to.Ptr("20.0.0.12/30"), - // }}, - // IPv6Routes: []*armmanagednetworkfabric.StaticRouteProperties{ - // { - // NextHop: []*string{ - // to.Ptr("4FFE:FFFF:0:CD30::ac")}, - // Prefix: to.Ptr("3FFE:FFFF:0:CD30::ac/127"), - // }}, - // }, - // OptionBLayer3Configuration: &armmanagednetworkfabric.NetworkToNetworkInterconnectPropertiesOptionBLayer3Configuration{ - // PrimaryIPv4Prefix: to.Ptr("10.0.0.12/30"), - // PrimaryIPv6Prefix: to.Ptr("4FFE:FFFF:0:CD30::a8/127"), - // SecondaryIPv4Prefix: to.Ptr("40.0.0.14/30"), - // SecondaryIPv6Prefix: to.Ptr("6FFE:FFFF:0:CD30::ac/127"), - // FabricASN: to.Ptr[int64](17), - // PeerASN: to.Ptr[int64](61234), - // VlanID: to.Ptr[int32](1234), - // }, - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // UseOptionB: to.Ptr(armmanagednetworkfabric.BooleanEnumPropertyTrue), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateNpbStaticRouteBfdAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_BeginUpdateNpbStaticRouteBfdAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdateNpbStaticRouteBfdAdministrativeState(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/NetworkToNetworkInterconnects_updateAdministrativeState_MaximumSet_Gen.json -func ExampleNetworkToNetworkInterconnectsClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkToNetworkInterconnectsClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-fabric", "example-nni", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go index e025f85366fb..9176a9fe0fb1 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armmanagednetworkfabric diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go deleted file mode 100644 index 6f40a9472cd7..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/operations_client_example_test.go +++ /dev/null @@ -1,82 +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 armmanagednetworkfabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armmanagednetworkfabric.OperationListResult{ - // Value: []*armmanagednetworkfabric.Operation{ - // { - // Name: to.Ptr("Microsoft.ManagedNetworkFabric/NetworkFabricControllers/Read"), - // ActionType: to.Ptr(armmanagednetworkfabric.ActionTypeInternal), - // Display: &armmanagednetworkfabric.OperationDisplay{ - // Description: to.Ptr("Gets/List the NetworkFabricController resource data."), - // Operation: to.Ptr("Gets/List NetworkFabricController resources."), - // Provider: to.Ptr("Microsoft.ManagedNetworkFabric resource provider"), - // Resource: to.Ptr("NetworkFabricControllers"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armmanagednetworkfabric.OriginUserSystem), - // }, - // { - // Name: to.Ptr("Microsoft.ManagedNetworkFabric/NetworkFabricControllers/Write"), - // ActionType: to.Ptr(armmanagednetworkfabric.ActionTypeInternal), - // Display: &armmanagednetworkfabric.OperationDisplay{ - // Description: to.Ptr("Create or Update NetworkFabricController resource data."), - // Operation: to.Ptr("Create or Update NetworkFabricController resource."), - // Provider: to.Ptr("Microsoft.ManagedNetworkFabric resource provider"), - // Resource: to.Ptr("NetworkFabricControllers"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armmanagednetworkfabric.OriginUserSystem), - // }, - // { - // Name: to.Ptr("Microsoft.ManagedNetworkFabric/NetworkFabricControllers/Delete"), - // ActionType: to.Ptr(armmanagednetworkfabric.ActionTypeInternal), - // Display: &armmanagednetworkfabric.OperationDisplay{ - // Description: to.Ptr("Deletes the NetworkFabricController resource."), - // Operation: to.Ptr("Deletes the NetworkFabricController resource."), - // Provider: to.Ptr("Microsoft.ManagedNetworkFabric resource provider"), - // Resource: to.Ptr("NetworkFabricControllers"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armmanagednetworkfabric.OriginUserSystem), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/options.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/options.go new file mode 100644 index 000000000000..b53af27d32b5 --- /dev/null +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/options.go @@ -0,0 +1,1036 @@ +//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 armmanagednetworkfabric + +// AccessControlListsClientBeginCreateOptions contains the optional parameters for the AccessControlListsClient.BeginCreate +// method. +type AccessControlListsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginDeleteOptions contains the optional parameters for the AccessControlListsClient.BeginDelete +// method. +type AccessControlListsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginResyncOptions contains the optional parameters for the AccessControlListsClient.BeginResync +// method. +type AccessControlListsClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdateAdministrativeState +// method. +type AccessControlListsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginUpdateOptions contains the optional parameters for the AccessControlListsClient.BeginUpdate +// method. +type AccessControlListsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientBeginValidateConfigurationOptions contains the optional parameters for the AccessControlListsClient.BeginValidateConfiguration +// method. +type AccessControlListsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccessControlListsClientGetOptions contains the optional parameters for the AccessControlListsClient.Get method. +type AccessControlListsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccessControlListsClientListByResourceGroupOptions contains the optional parameters for the AccessControlListsClient.NewListByResourceGroupPager +// method. +type AccessControlListsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AccessControlListsClientListBySubscriptionOptions contains the optional parameters for the AccessControlListsClient.NewListBySubscriptionPager +// method. +type AccessControlListsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ExternalNetworksClientBeginCreateOptions contains the optional parameters for the ExternalNetworksClient.BeginCreate method. +type ExternalNetworksClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExternalNetworksClientBeginDeleteOptions contains the optional parameters for the ExternalNetworksClient.BeginDelete method. +type ExternalNetworksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateAdministrativeState +// method. +type ExternalNetworksClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExternalNetworksClientBeginUpdateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdate method. +type ExternalNetworksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState +// method. +type ExternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExternalNetworksClientGetOptions contains the optional parameters for the ExternalNetworksClient.Get method. +type ExternalNetworksClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the ExternalNetworksClient.NewListByL3IsolationDomainPager +// method. +type ExternalNetworksClientListByL3IsolationDomainOptions struct { + // placeholder for future optional parameters +} + +// IPCommunitiesClientBeginCreateOptions contains the optional parameters for the IPCommunitiesClient.BeginCreate method. +type IPCommunitiesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPCommunitiesClient.BeginDelete method. +type IPCommunitiesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPCommunitiesClient.BeginUpdate method. +type IPCommunitiesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPCommunitiesClientGetOptions contains the optional parameters for the IPCommunitiesClient.Get method. +type IPCommunitiesClientGetOptions struct { + // placeholder for future optional parameters +} + +// IPCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPCommunitiesClient.NewListByResourceGroupPager +// method. +type IPCommunitiesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// IPCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPCommunitiesClient.NewListBySubscriptionPager +// method. +type IPCommunitiesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// IPExtendedCommunitiesClientBeginCreateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginCreate +// method. +type IPExtendedCommunitiesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPExtendedCommunitiesClientBeginDeleteOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginDelete +// method. +type IPExtendedCommunitiesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPExtendedCommunitiesClientBeginUpdateOptions contains the optional parameters for the IPExtendedCommunitiesClient.BeginUpdate +// method. +type IPExtendedCommunitiesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPExtendedCommunitiesClientGetOptions contains the optional parameters for the IPExtendedCommunitiesClient.Get method. +type IPExtendedCommunitiesClientGetOptions struct { + // placeholder for future optional parameters +} + +// IPExtendedCommunitiesClientListByResourceGroupOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListByResourceGroupPager +// method. +type IPExtendedCommunitiesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// IPExtendedCommunitiesClientListBySubscriptionOptions contains the optional parameters for the IPExtendedCommunitiesClient.NewListBySubscriptionPager +// method. +type IPExtendedCommunitiesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// IPPrefixesClientBeginCreateOptions contains the optional parameters for the IPPrefixesClient.BeginCreate method. +type IPPrefixesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPPrefixesClientBeginDeleteOptions contains the optional parameters for the IPPrefixesClient.BeginDelete method. +type IPPrefixesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPPrefixesClientBeginUpdateOptions contains the optional parameters for the IPPrefixesClient.BeginUpdate method. +type IPPrefixesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IPPrefixesClientGetOptions contains the optional parameters for the IPPrefixesClient.Get method. +type IPPrefixesClientGetOptions struct { + // placeholder for future optional parameters +} + +// IPPrefixesClientListByResourceGroupOptions contains the optional parameters for the IPPrefixesClient.NewListByResourceGroupPager +// method. +type IPPrefixesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// IPPrefixesClientListBySubscriptionOptions contains the optional parameters for the IPPrefixesClient.NewListBySubscriptionPager +// method. +type IPPrefixesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// InternalNetworksClientBeginCreateOptions contains the optional parameters for the InternalNetworksClient.BeginCreate method. +type InternalNetworksClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginDeleteOptions contains the optional parameters for the InternalNetworksClient.BeginDelete method. +type InternalNetworksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateAdministrativeState +// method. +type InternalNetworksClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateBgpAdministrativeState +// method. +type InternalNetworksClientBeginUpdateBgpAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginUpdateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdate method. +type InternalNetworksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions contains the optional parameters for the InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState +// method. +type InternalNetworksClientBeginUpdateStaticRouteBfdAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternalNetworksClientGetOptions contains the optional parameters for the InternalNetworksClient.Get method. +type InternalNetworksClientGetOptions struct { + // placeholder for future optional parameters +} + +// InternalNetworksClientListByL3IsolationDomainOptions contains the optional parameters for the InternalNetworksClient.NewListByL3IsolationDomainPager +// method. +type InternalNetworksClientListByL3IsolationDomainOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesClientBeginCreateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginCreate +// method. +type InternetGatewayRulesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewayRulesClientBeginDeleteOptions contains the optional parameters for the InternetGatewayRulesClient.BeginDelete +// method. +type InternetGatewayRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewayRulesClientBeginUpdateOptions contains the optional parameters for the InternetGatewayRulesClient.BeginUpdate +// method. +type InternetGatewayRulesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewayRulesClientGetOptions contains the optional parameters for the InternetGatewayRulesClient.Get method. +type InternetGatewayRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesClientListByResourceGroupOptions contains the optional parameters for the InternetGatewayRulesClient.NewListByResourceGroupPager +// method. +type InternetGatewayRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewayRulesClientListBySubscriptionOptions contains the optional parameters for the InternetGatewayRulesClient.NewListBySubscriptionPager +// method. +type InternetGatewayRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewaysClientBeginCreateOptions contains the optional parameters for the InternetGatewaysClient.BeginCreate method. +type InternetGatewaysClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewaysClientBeginDeleteOptions contains the optional parameters for the InternetGatewaysClient.BeginDelete method. +type InternetGatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewaysClientBeginUpdateOptions contains the optional parameters for the InternetGatewaysClient.BeginUpdate method. +type InternetGatewaysClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// InternetGatewaysClientGetOptions contains the optional parameters for the InternetGatewaysClient.Get method. +type InternetGatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewaysClientListByResourceGroupOptions contains the optional parameters for the InternetGatewaysClient.NewListByResourceGroupPager +// method. +type InternetGatewaysClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// InternetGatewaysClientListBySubscriptionOptions contains the optional parameters for the InternetGatewaysClient.NewListBySubscriptionPager +// method. +type InternetGatewaysClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// L2IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCommitConfiguration +// method. +type L2IsolationDomainsClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginCreate +// method. +type L2IsolationDomainsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L2IsolationDomainsClient.BeginDelete +// method. +type L2IsolationDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdateAdministrativeState +// method. +type L2IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L2IsolationDomainsClient.BeginUpdate +// method. +type L2IsolationDomainsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L2IsolationDomainsClient.BeginValidateConfiguration +// method. +type L2IsolationDomainsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L2IsolationDomainsClientGetOptions contains the optional parameters for the L2IsolationDomainsClient.Get method. +type L2IsolationDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// L2IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L2IsolationDomainsClient.NewListByResourceGroupPager +// method. +type L2IsolationDomainsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// L2IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L2IsolationDomainsClient.NewListBySubscriptionPager +// method. +type L2IsolationDomainsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// L3IsolationDomainsClientBeginCommitConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCommitConfiguration +// method. +type L3IsolationDomainsClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientBeginCreateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginCreate +// method. +type L3IsolationDomainsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientBeginDeleteOptions contains the optional parameters for the L3IsolationDomainsClient.BeginDelete +// method. +type L3IsolationDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdateAdministrativeState +// method. +type L3IsolationDomainsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientBeginUpdateOptions contains the optional parameters for the L3IsolationDomainsClient.BeginUpdate +// method. +type L3IsolationDomainsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientBeginValidateConfigurationOptions contains the optional parameters for the L3IsolationDomainsClient.BeginValidateConfiguration +// method. +type L3IsolationDomainsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// L3IsolationDomainsClientGetOptions contains the optional parameters for the L3IsolationDomainsClient.Get method. +type L3IsolationDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// L3IsolationDomainsClientListByResourceGroupOptions contains the optional parameters for the L3IsolationDomainsClient.NewListByResourceGroupPager +// method. +type L3IsolationDomainsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// L3IsolationDomainsClientListBySubscriptionOptions contains the optional parameters for the L3IsolationDomainsClient.NewListBySubscriptionPager +// method. +type L3IsolationDomainsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NeighborGroupsClientBeginCreateOptions contains the optional parameters for the NeighborGroupsClient.BeginCreate method. +type NeighborGroupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NeighborGroupsClientBeginDeleteOptions contains the optional parameters for the NeighborGroupsClient.BeginDelete method. +type NeighborGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NeighborGroupsClientBeginUpdateOptions contains the optional parameters for the NeighborGroupsClient.BeginUpdate method. +type NeighborGroupsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NeighborGroupsClientGetOptions contains the optional parameters for the NeighborGroupsClient.Get method. +type NeighborGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NeighborGroupsClientListByResourceGroupOptions contains the optional parameters for the NeighborGroupsClient.NewListByResourceGroupPager +// method. +type NeighborGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NeighborGroupsClientListBySubscriptionOptions contains the optional parameters for the NeighborGroupsClient.NewListBySubscriptionPager +// method. +type NeighborGroupsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkDeviceSKUsClientGetOptions contains the optional parameters for the NetworkDeviceSKUsClient.Get method. +type NetworkDeviceSKUsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkDeviceSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkDeviceSKUsClient.NewListBySubscriptionPager +// method. +type NetworkDeviceSKUsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkDevicesClientBeginCreateOptions contains the optional parameters for the NetworkDevicesClient.BeginCreate method. +type NetworkDevicesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginDeleteOptions contains the optional parameters for the NetworkDevicesClient.BeginDelete method. +type NetworkDevicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginRebootOptions contains the optional parameters for the NetworkDevicesClient.BeginReboot method. +type NetworkDevicesClientBeginRebootOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkDevicesClient.BeginRefreshConfiguration +// method. +type NetworkDevicesClientBeginRefreshConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdateAdministrativeState +// method. +type NetworkDevicesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginUpdateOptions contains the optional parameters for the NetworkDevicesClient.BeginUpdate method. +type NetworkDevicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientBeginUpgradeOptions contains the optional parameters for the NetworkDevicesClient.BeginUpgrade method. +type NetworkDevicesClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkDevicesClientGetOptions contains the optional parameters for the NetworkDevicesClient.Get method. +type NetworkDevicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkDevicesClientListByResourceGroupOptions contains the optional parameters for the NetworkDevicesClient.NewListByResourceGroupPager +// method. +type NetworkDevicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkDevicesClientListBySubscriptionOptions contains the optional parameters for the NetworkDevicesClient.NewListBySubscriptionPager +// method. +type NetworkDevicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricControllersClientBeginCreateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginCreate +// method. +type NetworkFabricControllersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricControllersClientBeginDeleteOptions contains the optional parameters for the NetworkFabricControllersClient.BeginDelete +// method. +type NetworkFabricControllersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricControllersClientBeginUpdateOptions contains the optional parameters for the NetworkFabricControllersClient.BeginUpdate +// method. +type NetworkFabricControllersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricControllersClientGetOptions contains the optional parameters for the NetworkFabricControllersClient.Get method. +type NetworkFabricControllersClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricControllersClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricControllersClient.NewListByResourceGroupPager +// method. +type NetworkFabricControllersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricControllersClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricControllersClient.NewListBySubscriptionPager +// method. +type NetworkFabricControllersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricSKUsClientGetOptions contains the optional parameters for the NetworkFabricSKUsClient.Get method. +type NetworkFabricSKUsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricSKUsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricSKUsClient.NewListBySubscriptionPager +// method. +type NetworkFabricSKUsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricsClientBeginCommitConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginCommitConfiguration +// method. +type NetworkFabricsClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginCreateOptions contains the optional parameters for the NetworkFabricsClient.BeginCreate method. +type NetworkFabricsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginDeleteOptions contains the optional parameters for the NetworkFabricsClient.BeginDelete method. +type NetworkFabricsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginDeprovisionOptions contains the optional parameters for the NetworkFabricsClient.BeginDeprovision +// method. +type NetworkFabricsClientBeginDeprovisionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginGetTopologyOptions contains the optional parameters for the NetworkFabricsClient.BeginGetTopology +// method. +type NetworkFabricsClientBeginGetTopologyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginProvisionOptions contains the optional parameters for the NetworkFabricsClient.BeginProvision +// method. +type NetworkFabricsClientBeginProvisionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginRefreshConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginRefreshConfiguration +// method. +type NetworkFabricsClientBeginRefreshConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration +// method. +type NetworkFabricsClientBeginUpdateInfraManagementBfdConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpdateOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdate method. +type NetworkFabricsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration +// method. +type NetworkFabricsClientBeginUpdateWorkloadManagementBfdConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginUpgradeOptions contains the optional parameters for the NetworkFabricsClient.BeginUpgrade method. +type NetworkFabricsClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkFabricsClient.BeginValidateConfiguration +// method. +type NetworkFabricsClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkFabricsClientGetOptions contains the optional parameters for the NetworkFabricsClient.Get method. +type NetworkFabricsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricsClientListByResourceGroupOptions contains the optional parameters for the NetworkFabricsClient.NewListByResourceGroupPager +// method. +type NetworkFabricsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkFabricsClientListBySubscriptionOptions contains the optional parameters for the NetworkFabricsClient.NewListBySubscriptionPager +// method. +type NetworkFabricsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkInterfacesClientBeginCreateOptions contains the optional parameters for the NetworkInterfacesClient.BeginCreate +// method. +type NetworkInterfacesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkInterfacesClientBeginDeleteOptions contains the optional parameters for the NetworkInterfacesClient.BeginDelete +// method. +type NetworkInterfacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkInterfacesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdateAdministrativeState +// method. +type NetworkInterfacesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkInterfacesClientBeginUpdateOptions contains the optional parameters for the NetworkInterfacesClient.BeginUpdate +// method. +type NetworkInterfacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkInterfacesClientGetOptions contains the optional parameters for the NetworkInterfacesClient.Get method. +type NetworkInterfacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkInterfacesClientListByNetworkDeviceOptions contains the optional parameters for the NetworkInterfacesClient.NewListByNetworkDevicePager +// method. +type NetworkInterfacesClientListByNetworkDeviceOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersClientBeginCreateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginCreate +// method. +type NetworkPacketBrokersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientBeginDeleteOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginDelete +// method. +type NetworkPacketBrokersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientBeginUpdateOptions contains the optional parameters for the NetworkPacketBrokersClient.BeginUpdate +// method. +type NetworkPacketBrokersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkPacketBrokersClientGetOptions contains the optional parameters for the NetworkPacketBrokersClient.Get method. +type NetworkPacketBrokersClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersClientListByResourceGroupOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListByResourceGroupPager +// method. +type NetworkPacketBrokersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkPacketBrokersClientListBySubscriptionOptions contains the optional parameters for the NetworkPacketBrokersClient.NewListBySubscriptionPager +// method. +type NetworkPacketBrokersClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksClientBeginCreateOptions contains the optional parameters for the NetworkRacksClient.BeginCreate method. +type NetworkRacksClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientBeginDeleteOptions contains the optional parameters for the NetworkRacksClient.BeginDelete method. +type NetworkRacksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientBeginUpdateOptions contains the optional parameters for the NetworkRacksClient.BeginUpdate method. +type NetworkRacksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkRacksClientGetOptions contains the optional parameters for the NetworkRacksClient.Get method. +type NetworkRacksClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksClientListByResourceGroupOptions contains the optional parameters for the NetworkRacksClient.NewListByResourceGroupPager +// method. +type NetworkRacksClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkRacksClientListBySubscriptionOptions contains the optional parameters for the NetworkRacksClient.NewListBySubscriptionPager +// method. +type NetworkRacksClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapRulesClientBeginCreateOptions contains the optional parameters for the NetworkTapRulesClient.BeginCreate method. +type NetworkTapRulesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginDeleteOptions contains the optional parameters for the NetworkTapRulesClient.BeginDelete method. +type NetworkTapRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginResyncOptions contains the optional parameters for the NetworkTapRulesClient.BeginResync method. +type NetworkTapRulesClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdateAdministrativeState +// method. +type NetworkTapRulesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginUpdateOptions contains the optional parameters for the NetworkTapRulesClient.BeginUpdate method. +type NetworkTapRulesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientBeginValidateConfigurationOptions contains the optional parameters for the NetworkTapRulesClient.BeginValidateConfiguration +// method. +type NetworkTapRulesClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapRulesClientGetOptions contains the optional parameters for the NetworkTapRulesClient.Get method. +type NetworkTapRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapRulesClientListByResourceGroupOptions contains the optional parameters for the NetworkTapRulesClient.NewListByResourceGroupPager +// method. +type NetworkTapRulesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapRulesClientListBySubscriptionOptions contains the optional parameters for the NetworkTapRulesClient.NewListBySubscriptionPager +// method. +type NetworkTapRulesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapsClientBeginCreateOptions contains the optional parameters for the NetworkTapsClient.BeginCreate method. +type NetworkTapsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientBeginDeleteOptions contains the optional parameters for the NetworkTapsClient.BeginDelete method. +type NetworkTapsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientBeginResyncOptions contains the optional parameters for the NetworkTapsClient.BeginResync method. +type NetworkTapsClientBeginResyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdateAdministrativeState +// method. +type NetworkTapsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientBeginUpdateOptions contains the optional parameters for the NetworkTapsClient.BeginUpdate method. +type NetworkTapsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkTapsClientGetOptions contains the optional parameters for the NetworkTapsClient.Get method. +type NetworkTapsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapsClientListByResourceGroupOptions contains the optional parameters for the NetworkTapsClient.NewListByResourceGroupPager +// method. +type NetworkTapsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// NetworkTapsClientListBySubscriptionOptions contains the optional parameters for the NetworkTapsClient.NewListBySubscriptionPager +// method. +type NetworkTapsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// NetworkToNetworkInterconnectsClientBeginCreateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginCreate +// method. +type NetworkToNetworkInterconnectsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginDeleteOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginDelete +// method. +type NetworkToNetworkInterconnectsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState +// method. +type NetworkToNetworkInterconnectsClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions contains the optional parameters +// for the NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState method. +type NetworkToNetworkInterconnectsClientBeginUpdateNpbStaticRouteBfdAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientBeginUpdateOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.BeginUpdate +// method. +type NetworkToNetworkInterconnectsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkToNetworkInterconnectsClientGetOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.Get +// method. +type NetworkToNetworkInterconnectsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkToNetworkInterconnectsClientListByNetworkFabricOptions contains the optional parameters for the NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager +// method. +type NetworkToNetworkInterconnectsClientListByNetworkFabricOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// RoutePoliciesClientBeginCommitConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginCommitConfiguration +// method. +type RoutePoliciesClientBeginCommitConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientBeginCreateOptions contains the optional parameters for the RoutePoliciesClient.BeginCreate method. +type RoutePoliciesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientBeginDeleteOptions contains the optional parameters for the RoutePoliciesClient.BeginDelete method. +type RoutePoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientBeginUpdateAdministrativeStateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdateAdministrativeState +// method. +type RoutePoliciesClientBeginUpdateAdministrativeStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientBeginUpdateOptions contains the optional parameters for the RoutePoliciesClient.BeginUpdate method. +type RoutePoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientBeginValidateConfigurationOptions contains the optional parameters for the RoutePoliciesClient.BeginValidateConfiguration +// method. +type RoutePoliciesClientBeginValidateConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RoutePoliciesClientGetOptions contains the optional parameters for the RoutePoliciesClient.Get method. +type RoutePoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RoutePoliciesClientListByResourceGroupOptions contains the optional parameters for the RoutePoliciesClient.NewListByResourceGroupPager +// method. +type RoutePoliciesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// RoutePoliciesClientListBySubscriptionOptions contains the optional parameters for the RoutePoliciesClient.NewListBySubscriptionPager +// method. +type RoutePoliciesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go index 42276005dd00..e10acecae4b8 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/response_types.go @@ -3,14 +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 armmanagednetworkfabric // AccessControlListsClientCreateResponse contains the response from method AccessControlListsClient.BeginCreate. type AccessControlListsClientCreateResponse struct { + // The Access Control List resource definition. AccessControlList } @@ -21,41 +21,49 @@ type AccessControlListsClientDeleteResponse struct { // AccessControlListsClientGetResponse contains the response from method AccessControlListsClient.Get. type AccessControlListsClientGetResponse struct { + // The Access Control List resource definition. AccessControlList } // AccessControlListsClientListByResourceGroupResponse contains the response from method AccessControlListsClient.NewListByResourceGroupPager. type AccessControlListsClientListByResourceGroupResponse struct { + // List of Access Control Lists. AccessControlListsListResult } // AccessControlListsClientListBySubscriptionResponse contains the response from method AccessControlListsClient.NewListBySubscriptionPager. type AccessControlListsClientListBySubscriptionResponse struct { + // List of Access Control Lists. AccessControlListsListResult } // AccessControlListsClientResyncResponse contains the response from method AccessControlListsClient.BeginResync. type AccessControlListsClientResyncResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // AccessControlListsClientUpdateAdministrativeStateResponse contains the response from method AccessControlListsClient.BeginUpdateAdministrativeState. type AccessControlListsClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // AccessControlListsClientUpdateResponse contains the response from method AccessControlListsClient.BeginUpdate. type AccessControlListsClientUpdateResponse struct { + // The Access Control List resource definition. AccessControlList } // AccessControlListsClientValidateConfigurationResponse contains the response from method AccessControlListsClient.BeginValidateConfiguration. type AccessControlListsClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // ExternalNetworksClientCreateResponse contains the response from method ExternalNetworksClient.BeginCreate. type ExternalNetworksClientCreateResponse struct { + // Defines the External Network resource. ExternalNetwork } @@ -66,31 +74,37 @@ type ExternalNetworksClientDeleteResponse struct { // ExternalNetworksClientGetResponse contains the response from method ExternalNetworksClient.Get. type ExternalNetworksClientGetResponse struct { + // Defines the External Network resource. ExternalNetwork } // ExternalNetworksClientListByL3IsolationDomainResponse contains the response from method ExternalNetworksClient.NewListByL3IsolationDomainPager. type ExternalNetworksClientListByL3IsolationDomainResponse struct { + // List of External Networks. ExternalNetworksList } // ExternalNetworksClientUpdateAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateAdministrativeState. type ExternalNetworksClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // ExternalNetworksClientUpdateResponse contains the response from method ExternalNetworksClient.BeginUpdate. type ExternalNetworksClientUpdateResponse struct { + // Defines the External Network resource. ExternalNetwork } // ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse contains the response from method ExternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState. type ExternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // IPCommunitiesClientCreateResponse contains the response from method IPCommunitiesClient.BeginCreate. type IPCommunitiesClientCreateResponse struct { + // The IP Community resource definition. IPCommunity } @@ -101,26 +115,31 @@ type IPCommunitiesClientDeleteResponse struct { // IPCommunitiesClientGetResponse contains the response from method IPCommunitiesClient.Get. type IPCommunitiesClientGetResponse struct { + // The IP Community resource definition. IPCommunity } // IPCommunitiesClientListByResourceGroupResponse contains the response from method IPCommunitiesClient.NewListByResourceGroupPager. type IPCommunitiesClientListByResourceGroupResponse struct { + // List of IP Communities. IPCommunitiesListResult } // IPCommunitiesClientListBySubscriptionResponse contains the response from method IPCommunitiesClient.NewListBySubscriptionPager. type IPCommunitiesClientListBySubscriptionResponse struct { + // List of IP Communities. IPCommunitiesListResult } // IPCommunitiesClientUpdateResponse contains the response from method IPCommunitiesClient.BeginUpdate. type IPCommunitiesClientUpdateResponse struct { + // The IP Community resource definition. IPCommunity } // IPExtendedCommunitiesClientCreateResponse contains the response from method IPExtendedCommunitiesClient.BeginCreate. type IPExtendedCommunitiesClientCreateResponse struct { + // The IP Extended Community resource definition. IPExtendedCommunity } @@ -131,26 +150,31 @@ type IPExtendedCommunitiesClientDeleteResponse struct { // IPExtendedCommunitiesClientGetResponse contains the response from method IPExtendedCommunitiesClient.Get. type IPExtendedCommunitiesClientGetResponse struct { + // The IP Extended Community resource definition. IPExtendedCommunity } // IPExtendedCommunitiesClientListByResourceGroupResponse contains the response from method IPExtendedCommunitiesClient.NewListByResourceGroupPager. type IPExtendedCommunitiesClientListByResourceGroupResponse struct { + // List of IP Extended Communities. IPExtendedCommunityListResult } // IPExtendedCommunitiesClientListBySubscriptionResponse contains the response from method IPExtendedCommunitiesClient.NewListBySubscriptionPager. type IPExtendedCommunitiesClientListBySubscriptionResponse struct { + // List of IP Extended Communities. IPExtendedCommunityListResult } // IPExtendedCommunitiesClientUpdateResponse contains the response from method IPExtendedCommunitiesClient.BeginUpdate. type IPExtendedCommunitiesClientUpdateResponse struct { + // The IP Extended Community resource definition. IPExtendedCommunity } // IPPrefixesClientCreateResponse contains the response from method IPPrefixesClient.BeginCreate. type IPPrefixesClientCreateResponse struct { + // The IP Prefix resource definition. IPPrefix } @@ -161,26 +185,31 @@ type IPPrefixesClientDeleteResponse struct { // IPPrefixesClientGetResponse contains the response from method IPPrefixesClient.Get. type IPPrefixesClientGetResponse struct { + // The IP Prefix resource definition. IPPrefix } // IPPrefixesClientListByResourceGroupResponse contains the response from method IPPrefixesClient.NewListByResourceGroupPager. type IPPrefixesClientListByResourceGroupResponse struct { + // List of IP Prefixes. IPPrefixesListResult } // IPPrefixesClientListBySubscriptionResponse contains the response from method IPPrefixesClient.NewListBySubscriptionPager. type IPPrefixesClientListBySubscriptionResponse struct { + // List of IP Prefixes. IPPrefixesListResult } // IPPrefixesClientUpdateResponse contains the response from method IPPrefixesClient.BeginUpdate. type IPPrefixesClientUpdateResponse struct { + // The IP Prefix resource definition. IPPrefix } // InternalNetworksClientCreateResponse contains the response from method InternalNetworksClient.BeginCreate. type InternalNetworksClientCreateResponse struct { + // Defines the Internal Network resource. InternalNetwork } @@ -191,36 +220,43 @@ type InternalNetworksClientDeleteResponse struct { // InternalNetworksClientGetResponse contains the response from method InternalNetworksClient.Get. type InternalNetworksClientGetResponse struct { + // Defines the Internal Network resource. InternalNetwork } // InternalNetworksClientListByL3IsolationDomainResponse contains the response from method InternalNetworksClient.NewListByL3IsolationDomainPager. type InternalNetworksClientListByL3IsolationDomainResponse struct { + // List of Internal Networks. InternalNetworksList } // InternalNetworksClientUpdateAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateAdministrativeState. type InternalNetworksClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // InternalNetworksClientUpdateBgpAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateBgpAdministrativeState. type InternalNetworksClientUpdateBgpAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // InternalNetworksClientUpdateResponse contains the response from method InternalNetworksClient.BeginUpdate. type InternalNetworksClientUpdateResponse struct { + // Defines the Internal Network resource. InternalNetwork } // InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse contains the response from method InternalNetworksClient.BeginUpdateStaticRouteBfdAdministrativeState. type InternalNetworksClientUpdateStaticRouteBfdAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // InternetGatewayRulesClientCreateResponse contains the response from method InternetGatewayRulesClient.BeginCreate. type InternetGatewayRulesClientCreateResponse struct { + // The Internet Gateway Rule resource definition. InternetGatewayRule } @@ -231,26 +267,31 @@ type InternetGatewayRulesClientDeleteResponse struct { // InternetGatewayRulesClientGetResponse contains the response from method InternetGatewayRulesClient.Get. type InternetGatewayRulesClientGetResponse struct { + // The Internet Gateway Rule resource definition. InternetGatewayRule } // InternetGatewayRulesClientListByResourceGroupResponse contains the response from method InternetGatewayRulesClient.NewListByResourceGroupPager. type InternetGatewayRulesClientListByResourceGroupResponse struct { + // List of Internet Gateway Rules. InternetGatewayRulesListResult } // InternetGatewayRulesClientListBySubscriptionResponse contains the response from method InternetGatewayRulesClient.NewListBySubscriptionPager. type InternetGatewayRulesClientListBySubscriptionResponse struct { + // List of Internet Gateway Rules. InternetGatewayRulesListResult } // InternetGatewayRulesClientUpdateResponse contains the response from method InternetGatewayRulesClient.BeginUpdate. type InternetGatewayRulesClientUpdateResponse struct { + // The Internet Gateway Rule resource definition. InternetGatewayRule } // InternetGatewaysClientCreateResponse contains the response from method InternetGatewaysClient.BeginCreate. type InternetGatewaysClientCreateResponse struct { + // The Internet Gateway resource definition. InternetGateway } @@ -261,31 +302,37 @@ type InternetGatewaysClientDeleteResponse struct { // InternetGatewaysClientGetResponse contains the response from method InternetGatewaysClient.Get. type InternetGatewaysClientGetResponse struct { + // The Internet Gateway resource definition. InternetGateway } // InternetGatewaysClientListByResourceGroupResponse contains the response from method InternetGatewaysClient.NewListByResourceGroupPager. type InternetGatewaysClientListByResourceGroupResponse struct { + // List of InternetGateways. InternetGatewaysListResult } // InternetGatewaysClientListBySubscriptionResponse contains the response from method InternetGatewaysClient.NewListBySubscriptionPager. type InternetGatewaysClientListBySubscriptionResponse struct { + // List of InternetGateways. InternetGatewaysListResult } // InternetGatewaysClientUpdateResponse contains the response from method InternetGatewaysClient.BeginUpdate. type InternetGatewaysClientUpdateResponse struct { + // The Internet Gateway resource definition. InternetGateway } // L2IsolationDomainsClientCommitConfigurationResponse contains the response from method L2IsolationDomainsClient.BeginCommitConfiguration. type L2IsolationDomainsClientCommitConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // L2IsolationDomainsClientCreateResponse contains the response from method L2IsolationDomainsClient.BeginCreate. type L2IsolationDomainsClientCreateResponse struct { + // The L2 Isolation Domain resource definition. L2IsolationDomain } @@ -296,41 +343,49 @@ type L2IsolationDomainsClientDeleteResponse struct { // L2IsolationDomainsClientGetResponse contains the response from method L2IsolationDomainsClient.Get. type L2IsolationDomainsClientGetResponse struct { + // The L2 Isolation Domain resource definition. L2IsolationDomain } // L2IsolationDomainsClientListByResourceGroupResponse contains the response from method L2IsolationDomainsClient.NewListByResourceGroupPager. type L2IsolationDomainsClientListByResourceGroupResponse struct { + // List of L2 Isolation Domains. L2IsolationDomainsListResult } // L2IsolationDomainsClientListBySubscriptionResponse contains the response from method L2IsolationDomainsClient.NewListBySubscriptionPager. type L2IsolationDomainsClientListBySubscriptionResponse struct { + // List of L2 Isolation Domains. L2IsolationDomainsListResult } // L2IsolationDomainsClientUpdateAdministrativeStateResponse contains the response from method L2IsolationDomainsClient.BeginUpdateAdministrativeState. type L2IsolationDomainsClientUpdateAdministrativeStateResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // L2IsolationDomainsClientUpdateResponse contains the response from method L2IsolationDomainsClient.BeginUpdate. type L2IsolationDomainsClientUpdateResponse struct { + // The L2 Isolation Domain resource definition. L2IsolationDomain } // L2IsolationDomainsClientValidateConfigurationResponse contains the response from method L2IsolationDomainsClient.BeginValidateConfiguration. type L2IsolationDomainsClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // L3IsolationDomainsClientCommitConfigurationResponse contains the response from method L3IsolationDomainsClient.BeginCommitConfiguration. type L3IsolationDomainsClientCommitConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // L3IsolationDomainsClientCreateResponse contains the response from method L3IsolationDomainsClient.BeginCreate. type L3IsolationDomainsClientCreateResponse struct { + // The L3 Isolation Domain resource definition. L3IsolationDomain } @@ -341,36 +396,43 @@ type L3IsolationDomainsClientDeleteResponse struct { // L3IsolationDomainsClientGetResponse contains the response from method L3IsolationDomainsClient.Get. type L3IsolationDomainsClientGetResponse struct { + // The L3 Isolation Domain resource definition. L3IsolationDomain } // L3IsolationDomainsClientListByResourceGroupResponse contains the response from method L3IsolationDomainsClient.NewListByResourceGroupPager. type L3IsolationDomainsClientListByResourceGroupResponse struct { + // List of L3 Isolation Domains. L3IsolationDomainsListResult } // L3IsolationDomainsClientListBySubscriptionResponse contains the response from method L3IsolationDomainsClient.NewListBySubscriptionPager. type L3IsolationDomainsClientListBySubscriptionResponse struct { + // List of L3 Isolation Domains. L3IsolationDomainsListResult } // L3IsolationDomainsClientUpdateAdministrativeStateResponse contains the response from method L3IsolationDomainsClient.BeginUpdateAdministrativeState. type L3IsolationDomainsClientUpdateAdministrativeStateResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // L3IsolationDomainsClientUpdateResponse contains the response from method L3IsolationDomainsClient.BeginUpdate. type L3IsolationDomainsClientUpdateResponse struct { + // The L3 Isolation Domain resource definition. L3IsolationDomain } // L3IsolationDomainsClientValidateConfigurationResponse contains the response from method L3IsolationDomainsClient.BeginValidateConfiguration. type L3IsolationDomainsClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // NeighborGroupsClientCreateResponse contains the response from method NeighborGroupsClient.BeginCreate. type NeighborGroupsClientCreateResponse struct { + // Defines the Neighbor Group. NeighborGroup } @@ -381,36 +443,43 @@ type NeighborGroupsClientDeleteResponse struct { // NeighborGroupsClientGetResponse contains the response from method NeighborGroupsClient.Get. type NeighborGroupsClientGetResponse struct { + // Defines the Neighbor Group. NeighborGroup } // NeighborGroupsClientListByResourceGroupResponse contains the response from method NeighborGroupsClient.NewListByResourceGroupPager. type NeighborGroupsClientListByResourceGroupResponse struct { + // List of Neighbor Group. NeighborGroupsListResult } // NeighborGroupsClientListBySubscriptionResponse contains the response from method NeighborGroupsClient.NewListBySubscriptionPager. type NeighborGroupsClientListBySubscriptionResponse struct { + // List of Neighbor Group. NeighborGroupsListResult } // NeighborGroupsClientUpdateResponse contains the response from method NeighborGroupsClient.BeginUpdate. type NeighborGroupsClientUpdateResponse struct { + // Defines the Neighbor Group. NeighborGroup } // NetworkDeviceSKUsClientGetResponse contains the response from method NetworkDeviceSKUsClient.Get. type NetworkDeviceSKUsClientGetResponse struct { + // The NetworkDeviceSku resource definition. NetworkDeviceSKU } // NetworkDeviceSKUsClientListBySubscriptionResponse contains the response from method NetworkDeviceSKUsClient.NewListBySubscriptionPager. type NetworkDeviceSKUsClientListBySubscriptionResponse struct { + // List of Network Device SKUs. NetworkDeviceSKUsListResult } // NetworkDevicesClientCreateResponse contains the response from method NetworkDevicesClient.BeginCreate. type NetworkDevicesClientCreateResponse struct { + // The Network Device resource definition. NetworkDevice } @@ -421,46 +490,55 @@ type NetworkDevicesClientDeleteResponse struct { // NetworkDevicesClientGetResponse contains the response from method NetworkDevicesClient.Get. type NetworkDevicesClientGetResponse struct { + // The Network Device resource definition. NetworkDevice } // NetworkDevicesClientListByResourceGroupResponse contains the response from method NetworkDevicesClient.NewListByResourceGroupPager. type NetworkDevicesClientListByResourceGroupResponse struct { + // List of NetworkDevices. NetworkDevicesListResult } // NetworkDevicesClientListBySubscriptionResponse contains the response from method NetworkDevicesClient.NewListBySubscriptionPager. type NetworkDevicesClientListBySubscriptionResponse struct { + // List of NetworkDevices. NetworkDevicesListResult } // NetworkDevicesClientRebootResponse contains the response from method NetworkDevicesClient.BeginReboot. type NetworkDevicesClientRebootResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkDevicesClientRefreshConfigurationResponse contains the response from method NetworkDevicesClient.BeginRefreshConfiguration. type NetworkDevicesClientRefreshConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkDevicesClientUpdateAdministrativeStateResponse contains the response from method NetworkDevicesClient.BeginUpdateAdministrativeState. type NetworkDevicesClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkDevicesClientUpdateResponse contains the response from method NetworkDevicesClient.BeginUpdate. type NetworkDevicesClientUpdateResponse struct { + // The Network Device resource definition. NetworkDevice } // NetworkDevicesClientUpgradeResponse contains the response from method NetworkDevicesClient.BeginUpgrade. type NetworkDevicesClientUpgradeResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricControllersClientCreateResponse contains the response from method NetworkFabricControllersClient.BeginCreate. type NetworkFabricControllersClientCreateResponse struct { + // The Network Fabric Controller resource definition. NetworkFabricController } @@ -471,41 +549,49 @@ type NetworkFabricControllersClientDeleteResponse struct { // NetworkFabricControllersClientGetResponse contains the response from method NetworkFabricControllersClient.Get. type NetworkFabricControllersClientGetResponse struct { + // The Network Fabric Controller resource definition. NetworkFabricController } // NetworkFabricControllersClientListByResourceGroupResponse contains the response from method NetworkFabricControllersClient.NewListByResourceGroupPager. type NetworkFabricControllersClientListByResourceGroupResponse struct { + // List of Network Fabric Controllers. NetworkFabricControllersListResult } // NetworkFabricControllersClientListBySubscriptionResponse contains the response from method NetworkFabricControllersClient.NewListBySubscriptionPager. type NetworkFabricControllersClientListBySubscriptionResponse struct { + // List of Network Fabric Controllers. NetworkFabricControllersListResult } // NetworkFabricControllersClientUpdateResponse contains the response from method NetworkFabricControllersClient.BeginUpdate. type NetworkFabricControllersClientUpdateResponse struct { + // The Network Fabric Controller resource definition. NetworkFabricController } // NetworkFabricSKUsClientGetResponse contains the response from method NetworkFabricSKUsClient.Get. type NetworkFabricSKUsClientGetResponse struct { + // The Network Fabric SKU resource definition. NetworkFabricSKU } // NetworkFabricSKUsClientListBySubscriptionResponse contains the response from method NetworkFabricSKUsClient.NewListBySubscriptionPager. type NetworkFabricSKUsClientListBySubscriptionResponse struct { + // List of Network Fabric SKUs. NetworkFabricSKUsListResult } // NetworkFabricsClientCommitConfigurationResponse contains the response from method NetworkFabricsClient.BeginCommitConfiguration. type NetworkFabricsClientCommitConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricsClientCreateResponse contains the response from method NetworkFabricsClient.BeginCreate. type NetworkFabricsClientCreateResponse struct { + // The Network Fabric resource definition. NetworkFabric } @@ -516,66 +602,79 @@ type NetworkFabricsClientDeleteResponse struct { // NetworkFabricsClientDeprovisionResponse contains the response from method NetworkFabricsClient.BeginDeprovision. type NetworkFabricsClientDeprovisionResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // NetworkFabricsClientGetResponse contains the response from method NetworkFabricsClient.Get. type NetworkFabricsClientGetResponse struct { + // The Network Fabric resource definition. NetworkFabric } // NetworkFabricsClientGetTopologyResponse contains the response from method NetworkFabricsClient.BeginGetTopology. type NetworkFabricsClientGetTopologyResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // NetworkFabricsClientListByResourceGroupResponse contains the response from method NetworkFabricsClient.NewListByResourceGroupPager. type NetworkFabricsClientListByResourceGroupResponse struct { + // List of Network Fabrics. NetworkFabricsListResult } // NetworkFabricsClientListBySubscriptionResponse contains the response from method NetworkFabricsClient.NewListBySubscriptionPager. type NetworkFabricsClientListBySubscriptionResponse struct { + // List of Network Fabrics. NetworkFabricsListResult } // NetworkFabricsClientProvisionResponse contains the response from method NetworkFabricsClient.BeginProvision. type NetworkFabricsClientProvisionResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // NetworkFabricsClientRefreshConfigurationResponse contains the response from method NetworkFabricsClient.BeginRefreshConfiguration. type NetworkFabricsClientRefreshConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse contains the response from method NetworkFabricsClient.BeginUpdateInfraManagementBfdConfiguration. type NetworkFabricsClientUpdateInfraManagementBfdConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricsClientUpdateResponse contains the response from method NetworkFabricsClient.BeginUpdate. type NetworkFabricsClientUpdateResponse struct { + // The Network Fabric resource definition. NetworkFabric } // NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse contains the response from method NetworkFabricsClient.BeginUpdateWorkloadManagementBfdConfiguration. type NetworkFabricsClientUpdateWorkloadManagementBfdConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricsClientUpgradeResponse contains the response from method NetworkFabricsClient.BeginUpgrade. type NetworkFabricsClientUpgradeResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkFabricsClientValidateConfigurationResponse contains the response from method NetworkFabricsClient.BeginValidateConfiguration. type NetworkFabricsClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // NetworkInterfacesClientCreateResponse contains the response from method NetworkInterfacesClient.BeginCreate. type NetworkInterfacesClientCreateResponse struct { + // Defines the NetworkInterface resource. NetworkInterface } @@ -586,26 +685,31 @@ type NetworkInterfacesClientDeleteResponse struct { // NetworkInterfacesClientGetResponse contains the response from method NetworkInterfacesClient.Get. type NetworkInterfacesClientGetResponse struct { + // Defines the NetworkInterface resource. NetworkInterface } // NetworkInterfacesClientListByNetworkDeviceResponse contains the response from method NetworkInterfacesClient.NewListByNetworkDevicePager. type NetworkInterfacesClientListByNetworkDeviceResponse struct { + // List of NetworkInterfaces. NetworkInterfacesList } // NetworkInterfacesClientUpdateAdministrativeStateResponse contains the response from method NetworkInterfacesClient.BeginUpdateAdministrativeState. type NetworkInterfacesClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkInterfacesClientUpdateResponse contains the response from method NetworkInterfacesClient.BeginUpdate. type NetworkInterfacesClientUpdateResponse struct { + // Defines the NetworkInterface resource. NetworkInterface } // NetworkPacketBrokersClientCreateResponse contains the response from method NetworkPacketBrokersClient.BeginCreate. type NetworkPacketBrokersClientCreateResponse struct { + // The NetworkPacketBroker resource definition. NetworkPacketBroker } @@ -616,26 +720,31 @@ type NetworkPacketBrokersClientDeleteResponse struct { // NetworkPacketBrokersClientGetResponse contains the response from method NetworkPacketBrokersClient.Get. type NetworkPacketBrokersClientGetResponse struct { + // The NetworkPacketBroker resource definition. NetworkPacketBroker } // NetworkPacketBrokersClientListByResourceGroupResponse contains the response from method NetworkPacketBrokersClient.NewListByResourceGroupPager. type NetworkPacketBrokersClientListByResourceGroupResponse struct { + // List of NetworkPacketBrokers. NetworkPacketBrokersListResult } // NetworkPacketBrokersClientListBySubscriptionResponse contains the response from method NetworkPacketBrokersClient.NewListBySubscriptionPager. type NetworkPacketBrokersClientListBySubscriptionResponse struct { + // List of NetworkPacketBrokers. NetworkPacketBrokersListResult } // NetworkPacketBrokersClientUpdateResponse contains the response from method NetworkPacketBrokersClient.BeginUpdate. type NetworkPacketBrokersClientUpdateResponse struct { + // The NetworkPacketBroker resource definition. NetworkPacketBroker } // NetworkRacksClientCreateResponse contains the response from method NetworkRacksClient.BeginCreate. type NetworkRacksClientCreateResponse struct { + // The Network Rack resource definition. NetworkRack } @@ -646,26 +755,31 @@ type NetworkRacksClientDeleteResponse struct { // NetworkRacksClientGetResponse contains the response from method NetworkRacksClient.Get. type NetworkRacksClientGetResponse struct { + // The Network Rack resource definition. NetworkRack } // NetworkRacksClientListByResourceGroupResponse contains the response from method NetworkRacksClient.NewListByResourceGroupPager. type NetworkRacksClientListByResourceGroupResponse struct { + // List of Network Racks. NetworkRacksListResult } // NetworkRacksClientListBySubscriptionResponse contains the response from method NetworkRacksClient.NewListBySubscriptionPager. type NetworkRacksClientListBySubscriptionResponse struct { + // List of Network Racks. NetworkRacksListResult } // NetworkRacksClientUpdateResponse contains the response from method NetworkRacksClient.BeginUpdate. type NetworkRacksClientUpdateResponse struct { + // The Network Rack resource definition. NetworkRack } // NetworkTapRulesClientCreateResponse contains the response from method NetworkTapRulesClient.BeginCreate. type NetworkTapRulesClientCreateResponse struct { + // The NetworkTapRule resource definition. NetworkTapRule } @@ -676,41 +790,49 @@ type NetworkTapRulesClientDeleteResponse struct { // NetworkTapRulesClientGetResponse contains the response from method NetworkTapRulesClient.Get. type NetworkTapRulesClientGetResponse struct { + // The NetworkTapRule resource definition. NetworkTapRule } // NetworkTapRulesClientListByResourceGroupResponse contains the response from method NetworkTapRulesClient.NewListByResourceGroupPager. type NetworkTapRulesClientListByResourceGroupResponse struct { + // List of NetworkTapRules. NetworkTapRulesListResult } // NetworkTapRulesClientListBySubscriptionResponse contains the response from method NetworkTapRulesClient.NewListBySubscriptionPager. type NetworkTapRulesClientListBySubscriptionResponse struct { + // List of NetworkTapRules. NetworkTapRulesListResult } // NetworkTapRulesClientResyncResponse contains the response from method NetworkTapRulesClient.BeginResync. type NetworkTapRulesClientResyncResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkTapRulesClientUpdateAdministrativeStateResponse contains the response from method NetworkTapRulesClient.BeginUpdateAdministrativeState. type NetworkTapRulesClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkTapRulesClientUpdateResponse contains the response from method NetworkTapRulesClient.BeginUpdate. type NetworkTapRulesClientUpdateResponse struct { + // The NetworkTapRule resource definition. NetworkTapRule } // NetworkTapRulesClientValidateConfigurationResponse contains the response from method NetworkTapRulesClient.BeginValidateConfiguration. type NetworkTapRulesClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } // NetworkTapsClientCreateResponse contains the response from method NetworkTapsClient.BeginCreate. type NetworkTapsClientCreateResponse struct { + // The Network Tap resource definition. NetworkTap } @@ -721,36 +843,43 @@ type NetworkTapsClientDeleteResponse struct { // NetworkTapsClientGetResponse contains the response from method NetworkTapsClient.Get. type NetworkTapsClientGetResponse struct { + // The Network Tap resource definition. NetworkTap } // NetworkTapsClientListByResourceGroupResponse contains the response from method NetworkTapsClient.NewListByResourceGroupPager. type NetworkTapsClientListByResourceGroupResponse struct { + // List of NetworkTaps. NetworkTapsListResult } // NetworkTapsClientListBySubscriptionResponse contains the response from method NetworkTapsClient.NewListBySubscriptionPager. type NetworkTapsClientListBySubscriptionResponse struct { + // List of NetworkTaps. NetworkTapsListResult } // NetworkTapsClientResyncResponse contains the response from method NetworkTapsClient.BeginResync. type NetworkTapsClientResyncResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkTapsClientUpdateAdministrativeStateResponse contains the response from method NetworkTapsClient.BeginUpdateAdministrativeState. type NetworkTapsClientUpdateAdministrativeStateResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // NetworkTapsClientUpdateResponse contains the response from method NetworkTapsClient.BeginUpdate. type NetworkTapsClientUpdateResponse struct { + // The Network Tap resource definition. NetworkTap } // NetworkToNetworkInterconnectsClientCreateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginCreate. type NetworkToNetworkInterconnectsClientCreateResponse struct { + // The Network To Network Interconnect resource definition. NetworkToNetworkInterconnect } @@ -761,42 +890,50 @@ type NetworkToNetworkInterconnectsClientDeleteResponse struct { // NetworkToNetworkInterconnectsClientGetResponse contains the response from method NetworkToNetworkInterconnectsClient.Get. type NetworkToNetworkInterconnectsClientGetResponse struct { + // The Network To Network Interconnect resource definition. NetworkToNetworkInterconnect } // NetworkToNetworkInterconnectsClientListByNetworkFabricResponse contains the response from method NetworkToNetworkInterconnectsClient.NewListByNetworkFabricPager. type NetworkToNetworkInterconnectsClientListByNetworkFabricResponse struct { + // List of Network To Network Interconnects. NetworkToNetworkInterconnectsList } // NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginUpdateAdministrativeState. type NetworkToNetworkInterconnectsClientUpdateAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse contains the response from method // NetworkToNetworkInterconnectsClient.BeginUpdateNpbStaticRouteBfdAdministrativeState. type NetworkToNetworkInterconnectsClientUpdateNpbStaticRouteBfdAdministrativeStateResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // NetworkToNetworkInterconnectsClientUpdateResponse contains the response from method NetworkToNetworkInterconnectsClient.BeginUpdate. type NetworkToNetworkInterconnectsClientUpdateResponse struct { + // The Network To Network Interconnect resource definition. NetworkToNetworkInterconnect } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. OperationListResult } // RoutePoliciesClientCommitConfigurationResponse contains the response from method RoutePoliciesClient.BeginCommitConfiguration. type RoutePoliciesClientCommitConfigurationResponse struct { + // Common response for the state updates. CommonPostActionResponseForStateUpdate } // RoutePoliciesClientCreateResponse contains the response from method RoutePoliciesClient.BeginCreate. type RoutePoliciesClientCreateResponse struct { + // The RoutePolicy resource definition. RoutePolicy } @@ -807,30 +944,36 @@ type RoutePoliciesClientDeleteResponse struct { // RoutePoliciesClientGetResponse contains the response from method RoutePoliciesClient.Get. type RoutePoliciesClientGetResponse struct { + // The RoutePolicy resource definition. RoutePolicy } // RoutePoliciesClientListByResourceGroupResponse contains the response from method RoutePoliciesClient.NewListByResourceGroupPager. type RoutePoliciesClientListByResourceGroupResponse struct { + // List of RoutePolicies. RoutePoliciesListResult } // RoutePoliciesClientListBySubscriptionResponse contains the response from method RoutePoliciesClient.NewListBySubscriptionPager. type RoutePoliciesClientListBySubscriptionResponse struct { + // List of RoutePolicies. RoutePoliciesListResult } // RoutePoliciesClientUpdateAdministrativeStateResponse contains the response from method RoutePoliciesClient.BeginUpdateAdministrativeState. type RoutePoliciesClientUpdateAdministrativeStateResponse struct { + // Common response for device updates. CommonPostActionResponseForDeviceUpdate } // RoutePoliciesClientUpdateResponse contains the response from method RoutePoliciesClient.BeginUpdate. type RoutePoliciesClientUpdateResponse struct { + // The RoutePolicy resource definition. RoutePolicy } // RoutePoliciesClientValidateConfigurationResponse contains the response from method RoutePoliciesClient.BeginValidateConfiguration. type RoutePoliciesClientValidateConfigurationResponse struct { + // The response of the action validate configuration. ValidateConfigurationResponse } diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go index 04266067b4c3..00f82886c183 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_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 armmanagednetworkfabric @@ -58,9 +57,10 @@ func (client *RoutePoliciesClient) BeginCommitConfiguration(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientCommitConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientCommitConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientCommitConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *RoutePoliciesClient) BeginCommitConfiguration(ctx context.Context, // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) commitConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginCommitConfigurationOptions) (*http.Response, error) { + var err error req, err := client.commitConfigurationCreateRequest(ctx, resourceGroupName, routePolicyName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // commitConfigurationCreateRequest creates the CommitConfiguration request. @@ -123,9 +125,10 @@ func (client *RoutePoliciesClient) BeginCreate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +139,20 @@ func (client *RoutePoliciesClient) BeginCreate(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) create(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicy, options *RoutePoliciesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, routePolicyName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -170,7 +175,10 @@ func (client *RoutePoliciesClient) createCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Implements Route Policy DELETE method. @@ -187,9 +195,10 @@ func (client *RoutePoliciesClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -200,18 +209,20 @@ func (client *RoutePoliciesClient) BeginDelete(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, routePolicyName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -245,18 +256,21 @@ func (client *RoutePoliciesClient) deleteCreateRequest(ctx context.Context, reso // - routePolicyName - Name of the Route Policy. // - options - RoutePoliciesClientGetOptions contains the optional parameters for the RoutePoliciesClient.Get method. func (client *RoutePoliciesClient) Get(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientGetOptions) (RoutePoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, routePolicyName, options) if err != nil { return RoutePoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RoutePoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoutePoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RoutePoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -425,9 +439,10 @@ func (client *RoutePoliciesClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -438,18 +453,20 @@ func (client *RoutePoliciesClient) BeginUpdate(ctx context.Context, resourceGrou // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) update(ctx context.Context, resourceGroupName string, routePolicyName string, body RoutePolicyPatch, options *RoutePoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, routePolicyName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -472,7 +489,10 @@ func (client *RoutePoliciesClient) updateCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdateAdministrativeState - Updated the admin state for this Route Policy. @@ -490,9 +510,10 @@ func (client *RoutePoliciesClient) BeginUpdateAdministrativeState(ctx context.Co if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientUpdateAdministrativeStateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientUpdateAdministrativeStateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientUpdateAdministrativeStateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -503,18 +524,20 @@ func (client *RoutePoliciesClient) BeginUpdateAdministrativeState(ctx context.Co // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) updateAdministrativeState(ctx context.Context, resourceGroupName string, routePolicyName string, body UpdateAdministrativeState, options *RoutePoliciesClientBeginUpdateAdministrativeStateOptions) (*http.Response, error) { + var err error req, err := client.updateAdministrativeStateCreateRequest(ctx, resourceGroupName, routePolicyName, body, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAdministrativeStateCreateRequest creates the UpdateAdministrativeState request. @@ -537,7 +560,10 @@ func (client *RoutePoliciesClient) updateAdministrativeStateCreateRequest(ctx co reqQP.Set("api-version", "2023-06-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginValidateConfiguration - Validates the configuration of the resources. @@ -554,9 +580,10 @@ func (client *RoutePoliciesClient) BeginValidateConfiguration(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientValidateConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[RoutePoliciesClientValidateConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[RoutePoliciesClientValidateConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -567,18 +594,20 @@ func (client *RoutePoliciesClient) BeginValidateConfiguration(ctx context.Contex // // Generated from API version 2023-06-15 func (client *RoutePoliciesClient) validateConfiguration(ctx context.Context, resourceGroupName string, routePolicyName string, options *RoutePoliciesClientBeginValidateConfigurationOptions) (*http.Response, error) { + var err error req, err := client.validateConfigurationCreateRequest(ctx, resourceGroupName, routePolicyName, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateConfigurationCreateRequest creates the ValidateConfiguration request. diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go deleted file mode 100644 index 8199c3854143..000000000000 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/routepolicies_client_example_test.go +++ /dev/null @@ -1,749 +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 armmanagednetworkfabric_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/managednetworkfabric/armmanagednetworkfabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Create_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginCreate(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.RoutePolicy{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - Annotation: to.Ptr("annotation"), - Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - { - Annotation: to.Ptr("annotation"), - Action: &armmanagednetworkfabric.StatementActionProperties{ - ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - Add: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - Delete: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - Set: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - }, - IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - }, - LocalPreference: to.Ptr[int64](20), - }, - Condition: &armmanagednetworkfabric.StatementConditionProperties{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - }, - SequenceNumber: to.Ptr[int64](7), - }}, - AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - }, - }, 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.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("example-routePolicy"), - // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotation"), - // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - // { - // Annotation: to.Ptr("annotation"), - // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - // Add: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // }, - // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // }, - // LocalPreference: to.Ptr[int64](20), - // }, - // Condition: &armmanagednetworkfabric.StatementConditionProperties{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // }, - // SequenceNumber: to.Ptr[int64](7), - // }}, - // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Get_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoutePoliciesClient().Get(ctx, "example-rg", "example-routePolicy", 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.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("example-routePolicy"), - // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotation"), - // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - // { - // Annotation: to.Ptr("annotation"), - // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - // Add: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // }, - // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // }, - // LocalPreference: to.Ptr[int64](20), - // }, - // Condition: &armmanagednetworkfabric.StatementConditionProperties{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // }, - // SequenceNumber: to.Ptr[int64](7), - // }}, - // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Update_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginUpdate(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.RoutePolicyPatch{ - Tags: map[string]*string{ - "keyID": to.Ptr("keyValue"), - }, - Properties: &armmanagednetworkfabric.RoutePolicyPatchableProperties{ - Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - { - Annotation: to.Ptr("annotation"), - Action: &armmanagednetworkfabric.StatementActionProperties{ - ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - Add: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - Delete: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - Set: &armmanagednetworkfabric.IPCommunityIDList{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - }, - }, - IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - }, - }, - LocalPreference: to.Ptr[int64](20), - }, - Condition: &armmanagednetworkfabric.StatementConditionProperties{ - IPCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - IPExtendedCommunityIDs: []*string{ - to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - }, - SequenceNumber: to.Ptr[int64](7), - }}, - }, - }, 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.RoutePolicy = armmanagednetworkfabric.RoutePolicy{ - // Name: to.Ptr("example-routePolicy"), - // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotation"), - // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - // { - // Annotation: to.Ptr("annotation"), - // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - // Add: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // }, - // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // }, - // LocalPreference: to.Ptr[int64](20), - // }, - // Condition: &armmanagednetworkfabric.StatementConditionProperties{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // }, - // SequenceNumber: to.Ptr[int64](7), - // }}, - // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_Delete_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginDelete(ctx, "example-rg", "example-routePolicy", 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/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListByResourceGroup_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutePoliciesClient().NewListByResourceGroupPager("example-rg", 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.RoutePoliciesListResult = armmanagednetworkfabric.RoutePoliciesListResult{ - // Value: []*armmanagednetworkfabric.RoutePolicy{ - // { - // Name: to.Ptr("example-routePolicy"), - // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotation"), - // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - // { - // Annotation: to.Ptr("annotation"), - // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - // Add: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // }, - // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // }, - // LocalPreference: to.Ptr[int64](20), - // }, - // Condition: &armmanagednetworkfabric.StatementConditionProperties{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // }, - // SequenceNumber: to.Ptr[int64](7), - // }}, - // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ListBySubscription_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoutePoliciesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RoutePoliciesListResult = armmanagednetworkfabric.RoutePoliciesListResult{ - // Value: []*armmanagednetworkfabric.RoutePolicy{ - // { - // Name: to.Ptr("example-routePolicy"), - // Type: to.Ptr("microsoft.managednetworkfabric/routePolicies"), - // ID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/routePolicies/example-routePolicy"), - // SystemData: &armmanagednetworkfabric.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // CreatedBy: to.Ptr("user@mail.com"), - // CreatedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-11T17:48:22.837Z"); return t}()), - // LastModifiedBy: to.Ptr("user@mail.com"), - // LastModifiedByType: to.Ptr(armmanagednetworkfabric.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "keyID": to.Ptr("keyValue"), - // }, - // Properties: &armmanagednetworkfabric.RoutePolicyProperties{ - // Annotation: to.Ptr("annotation"), - // Statements: []*armmanagednetworkfabric.RoutePolicyStatementProperties{ - // { - // Annotation: to.Ptr("annotation"), - // Action: &armmanagednetworkfabric.StatementActionProperties{ - // ActionType: to.Ptr(armmanagednetworkfabric.RoutePolicyActionTypePermit), - // IPCommunityProperties: &armmanagednetworkfabric.ActionIPCommunityProperties{ - // Add: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPCommunityIDList{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // }, - // }, - // IPExtendedCommunityProperties: &armmanagednetworkfabric.ActionIPExtendedCommunityProperties{ - // Add: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Delete: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // Set: &armmanagednetworkfabric.IPExtendedCommunityIDList{ - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // }, - // }, - // LocalPreference: to.Ptr[int64](20), - // }, - // Condition: &armmanagednetworkfabric.StatementConditionProperties{ - // IPCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipCommunities/example-ipCommunity")}, - // IPExtendedCommunityIDs: []*string{ - // to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipExtendedCommunities/example-ipExtendedCommunity")}, - // Type: to.Ptr(armmanagednetworkfabric.RoutePolicyConditionTypeOr), - // IPPrefixID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/ipPrefixes/example-ipPrefix"), - // }, - // SequenceNumber: to.Ptr[int64](7), - // }}, - // AddressFamilyType: to.Ptr(armmanagednetworkfabric.AddressFamilyTypeIPv4), - // AdministrativeState: to.Ptr(armmanagednetworkfabric.AdministrativeStateEnabled), - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // NetworkFabricID: to.Ptr("/subscriptions/1234ABCD-0A1B-1234-5678-123456ABCDEF/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkFabrics/example-fabric"), - // ProvisioningState: to.Ptr(armmanagednetworkfabric.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_UpdateAdministrativeState_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginUpdateAdministrativeState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginUpdateAdministrativeState(ctx, "example-rg", "example-routePolicy", armmanagednetworkfabric.UpdateAdministrativeState{ - ResourceIDs: []*string{ - to.Ptr("")}, - State: to.Ptr(armmanagednetworkfabric.EnableDisableStateEnable), - }, 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.CommonPostActionResponseForDeviceUpdate = armmanagednetworkfabric.CommonPostActionResponseForDeviceUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // FailedDevices: []*string{ - // to.Ptr("")}, - // SuccessfulDevices: []*string{ - // to.Ptr("")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_ValidateConfiguration_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginValidateConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginValidateConfiguration(ctx, "example-rg", "example-routePolicy", 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.ValidateConfigurationResponse = armmanagednetworkfabric.ValidateConfigurationResponse{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // URL: to.Ptr("https://ValidateResultsUrl"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/925ba149e17454ce91ecd3f9f4134effb2f97844/specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/stable/2023-06-15/examples/RoutePolicies_CommitConfiguration_MaximumSet_Gen.json -func ExampleRoutePoliciesClient_BeginCommitConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagednetworkfabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRoutePoliciesClient().BeginCommitConfiguration(ctx, "example-rg", "example-routePolicy", 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.CommonPostActionResponseForStateUpdate = armmanagednetworkfabric.CommonPostActionResponseForStateUpdate{ - // Error: &armmanagednetworkfabric.ErrorDetail{ - // AdditionalInfo: []*armmanagednetworkfabric.ErrorAdditionalInfo{ - // { - // Info: map[string]any{ - // }, - // Type: to.Ptr(""), - // }}, - // Code: to.Ptr(""), - // Message: to.Ptr(""), - // Target: to.Ptr(""), - // Details: []*armmanagednetworkfabric.ErrorDetail{ - // }, - // }, - // ConfigurationState: to.Ptr(armmanagednetworkfabric.ConfigurationStateSucceeded), - // } -} diff --git a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/time_rfc3339.go b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/time_rfc3339.go index 598ddb5a46b0..9b8d13077b66 100644 --- a/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/time_rfc3339.go +++ b/sdk/resourcemanager/managednetworkfabric/armmanagednetworkfabric/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 armmanagednetworkfabric